X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/cc248aae9bff569a771210e9b63f6f4dfe83e3a6..e51094b7210fc31fa67cc218c1bd30de841a426e:/popt/popthelp.c diff --git a/popt/popthelp.c b/popt/popthelp.c index 17adc6f2..1ddb895c 100644 --- a/popt/popthelp.c +++ b/popt/popthelp.c @@ -134,19 +134,23 @@ singleOptionDefaultValue(int lineLength, case POPT_ARG_VAL: case POPT_ARG_INT: { long aLong = *((int *)opt->arg); - le += sprintf(le, "%ld", aLong); + sprintf(le, "%ld", aLong); + le += strlen(le); } break; case POPT_ARG_LONG: { long aLong = *((long *)opt->arg); - le += sprintf(le, "%ld", aLong); + sprintf(le, "%ld", aLong); + le += strlen(le); } break; case POPT_ARG_FLOAT: { double aDouble = *((float *)opt->arg); - le += sprintf(le, "%g", aDouble); + sprintf(le, "%g", aDouble); + le += strlen(le); } break; case POPT_ARG_DOUBLE: { double aDouble = *((double *)opt->arg); - le += sprintf(le, "%g", aDouble); + sprintf(le, "%g", aDouble); + le += strlen(le); } break; case POPT_ARG_STRING: { const char * s = *(const char **)opt->arg; @@ -187,11 +191,11 @@ static void singleOptionHelp(FILE * fp, int maxLeftCol, { int indentLength = maxLeftCol + 5; int lineLength = 79 - indentLength; - const char * help = D_(translation_domain, opt->descrip); + const unsigned char * help = D_(translation_domain, opt->descrip); const char * argDescrip = getArgDescrip(opt, translation_domain); int helpLength; - char * defs = NULL; - char * left; + unsigned char * defs = NULL; + unsigned char * left; int nb = maxLeftCol + 1; /* Make sure there's more than enough room in target buffer. */ @@ -271,7 +275,8 @@ static void singleOptionHelp(FILE * fp, int maxLeftCol, *le++ = '='; if (negate) *le++ = '~'; /*@-formatconst@*/ - le += sprintf(le, (ops ? "0x%lx" : "%ld"), aLong); + sprintf(le, (ops ? "0x%lx" : "%ld"), aLong); + le += strlen(le); /*@=formatconst@*/ *le++ = ']'; } break; @@ -309,7 +314,7 @@ static void singleOptionHelp(FILE * fp, int maxLeftCol, helpLength = strlen(help); while (helpLength > lineLength) { - const char * ch; + const unsigned char * ch; char format[10]; ch = help + lineLength - 1;