Use %1023s as opposed to %1023c

Using %1023c doesn't work with musl.
This commit is contained in:
sin 2014-06-04 15:31:25 +01:00
parent 8441c95a2f
commit ba3366646a
1 changed files with 6 additions and 6 deletions

12
dd.c
View File

@ -239,19 +239,19 @@ main(int argc, char *argv[])
/* emulate 'dd' argument parsing */
for (i = 1; i < argc; ++i) {
memset(buf, 0, sizeof(buf));
if (sscanf(argv[i], "if=%1023c", buf) == 1)
if (sscanf(argv[i], "if=%1023s", buf) == 1)
config.in = strdup(buf);
else if (sscanf(argv[i], "of=%1023c", buf) == 1)
else if (sscanf(argv[i], "of=%1023s", buf) == 1)
config.out = strdup(buf);
else if (sscanf(argv[i], "skip=%1023c", buf) == 1)
else if (sscanf(argv[i], "skip=%1023s", buf) == 1)
config.skip = estrtoul(buf, 0);
else if (sscanf(argv[i], "seek=%1023c", buf) == 1)
else if (sscanf(argv[i], "seek=%1023s", buf) == 1)
config.seek = estrtoul(buf, 0);
else if (sscanf(argv[i], "count=%1023c", buf) == 1)
else if (sscanf(argv[i], "count=%1023s", buf) == 1)
config.count = estrtoul(buf, 0);
else if (strcmp(argv[i], "direct") == 0)
config.direct = 1;
else if (sscanf(argv[i], "bs=%1023c", buf) == 1)
else if (sscanf(argv[i], "bs=%1023s", buf) == 1)
config.bs = estrtoul(buf, 0);
else if (strcmp(argv[i], "bs") == 0)
config.bs = 0;