-/*
+/*
*------------------------------------------------------------------
* Copyright (c) 2005-2016 Cisco and/or its affiliates.
* Licensed under the Apache License, Version 2.0 (the "License");
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
+#include <vppinfra/mem.h>
/*
* globals
* [main window]
* [main vbox]
* [main (e.g. file) menubar]
- * [view hbox]
+ * [view hbox]
* [view bottom menu]
*/
char *title = "none";
int curarg=1;
char *homedir;
-
+
+ clib_mem_init (0, ((uword)3<<30));
+
gtk_init(&argc, &argv);
homedir = getenv ("HOME");
tmpbuf[0] = 0;
if (homedir) {
- sprintf(tmpbuf, "%s/.g2", homedir);
+ snprintf(tmpbuf, sizeof(tmpbuf), "%s/.g2", homedir);
} else {
pw = getpwuid(geteuid());
if (pw) {
- sprintf(tmpbuf, "%s/.g2", pw->pw_dir);
+ snprintf(tmpbuf, sizeof(tmpbuf), "%s/.g2", pw->pw_dir);
}
}
if (tmpbuf[0])
g_mainvbox = gtk_vbox_new(FALSE, 0);
g_mainhbox = gtk_hbox_new(FALSE, 0);
- /*
+ /*
* init routines
*/
view1_init();
event_init();
- /*
+ /*
* Now that we're ready to rock 'n roll, see if we've been asked to
* press a few buttons...
*/
-
+
while (curarg < argc) {
if (!strncmp(argv[curarg], "--cpel-input", 4)) {
curarg++;
g_error ("Missing filename after --event-log\n");
}
- fprintf(stderr,
+ fprintf(stderr,
"g2 [--pointdefs <filename>] [--event-log <filename>]\n");
fprintf(stderr, " [--ticks-per-us <value>]\n");
- fprintf(stderr,
+ fprintf(stderr,
" [--cpel-input <filename>] [--clib-input <filename]>\n");
- fprintf(stderr,
+ fprintf(stderr,
"%s\n%s\n", version_string, minor_v_string);
exit(0);
}