display_usage(basename(argv[0]));
} else if (!strcmp(argv[pi], "-m") || !strcmp(argv[pi], "--mcu")) {
if (pi < argc-1)
- strncpy(name, argv[++pi], sizeof(name));
+ snprintf(name, sizeof(name), "%s", argv[++pi]);
else
display_usage(basename(argv[0]));
} else if (!strcmp(argv[pi], "-f") || !strcmp(argv[pi], "--freq")) {
exit(1);
}
++pi;
- strncpy(f.tracename, argv[pi], sizeof(f.tracename));
+ snprintf(f.tracename, sizeof(f.tracename), "%s", argv[pi]);
} else if (!strcmp(argv[pi], "--add-vcd-trace")) {
if (pi + 1 >= argc) {
fprintf(stderr, "%s: missing mandatory argument for %s.\n", argv[0], argv[pi]);
fprintf(stderr, "%s: missing mandatory argument for %s.\n", argv[0], argv[pi]);
exit(1);
}
- strncpy(f.tracename, argv[++pi], sizeof(f.tracename));
+ snprintf(f.tracename, sizeof(f.tracename), "%s", argv[++pi]);
} else if (!strcmp(argv[pi], "-ti")) {
if (pi < argc-1)
trace_vectors[trace_vectors_count++] = atoi(argv[++pi]);