[hackers] [ubase] Use %1023s as opposed to %1023c || sin

From: <git_AT_suckless.org>
Date: Wed, 04 Jun 2014 16:36:23 +0200

commit ba3366646ac558920be4c91ec7f0256cce4013f9
Author: sin <sin_AT_2f30.org>
Date: Wed Jun 4 15:31:25 2014 +0100

    Use %1023s as opposed to %1023c
    
    Using %1023c doesn't work with musl.

diff --git a/dd.c b/dd.c
index 85cb7f7..c6f3258 100644
--- a/dd.c
+++ b/dd.c
_AT_@ -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;
Received on Wed Jun 04 2014 - 16:36:23 CEST

This archive was generated by hypermail 2.3.0 : Wed Jun 04 2014 - 16:48:07 CEST