summaryrefslogtreecommitdiff
path: root/popt
diff options
context:
space:
mode:
authorDavid Dykstra <dwd@samba.org>2003-01-14 21:37:08 +0000
committerDavid Dykstra <dwd@samba.org>2003-01-14 21:37:08 +0000
commitf58677d123775cf4e20ef3317183e083f04a9bb7 (patch)
tree9149c3e69790b45cea17ae80cf9ef2436ddc3dd6 /popt
parent7ab153886163714065519275c275200a3cbca230 (diff)
downloadrsync-f58677d123775cf4e20ef3317183e083f04a9bb7.tar.gz
rsync-f58677d123775cf4e20ef3317183e083f04a9bb7.tar.bz2
rsync-f58677d123775cf4e20ef3317183e083f04a9bb7.zip
Don't use the return value from sprintf because it doesn't work on Sunos4.
Diffstat (limited to 'popt')
-rw-r--r--popt/popthelp.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/popt/popthelp.c b/popt/popthelp.c
index 17adc6f2..5c800944 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;
@@ -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;