static int hexMode = HEXMODE;
-static const char trbcmd_version[] = "$Revision: 2.62 $";
+static const char trbcmd_version[] = "$Revision: 2.63 $";
#define BACKLOG 10
static uint16_t tcp_port = 55555;
abort();
while (getline(&line, &len, file) != -1) {
+ char* c = NULL;
+
if (size >= dataSize) {
dataSize += 64;
data = (uint32_t *) realloc(data, sizeof(uint32_t) * dataSize);
if (data == NULL)
abort();
}
+
+ /* Remove newline and comments */
+ if ((c = strchr(line, '\n')) != NULL) {
+ *c = '\0';
+ }
+ if ((c = strchr(line, '#')) != NULL) {
+ *c = '\0';
+ }
+ if (strlen(line) == 0) continue;
data[size++] = strtoul(line, NULL, hexMode == 1 ? 16 : 0);
}
free(line);