From: TJ S. <cas...@us...> - 2003-01-30 16:16:00
|
Update of /cvsroot/proftp/proftpd/modules In directory sc8-pr-cvs1:/tmp/cvs-serv23175/modules Modified Files: mod_xfer.c Log Message: Changed TransferRate handler to use strtod() rather than strtoul() when parsing the kbps rate parameter. strtold() would be better...but FreeBSD doesn't seem to have strtold(). *sigh* Index: mod_xfer.c =================================================================== RCS file: /cvsroot/proftp/proftpd/modules/mod_xfer.c,v retrieving revision 1.119 retrieving revision 1.120 diff -u -r1.119 -r1.120 --- mod_xfer.c 13 Jan 2003 04:25:59 -0000 1.119 +++ mod_xfer.c 30 Jan 2003 16:15:57 -0000 1.120 @@ -2083,8 +2083,10 @@ if ((tmp = strchr(cmd->argv[2], ':')) != NULL) *tmp = '\0'; - /* Parse the 'kbps' part */ - rate = (long double) strtoul(cmd->argv[2], &endp, 10); + /* Parse the 'kbps' part. Ideally, we'd be using strtold(3) rather than + * strtod(3) here, but FreeBSD doesn't have strtold(3). Yay. Portability. + */ + rate = (long double) strtod(cmd->argv[2], &endp); if (rate < 0.0) CONF_ERROR(cmd, "rate must be greater than zero"); |