View | Details | Raw Unified | Return to bug 3206
Collapse All | Expand All

(-)sftp.c (-5 / +5 lines)
Lines 1302-1308 parse_args(const char **cpp, int *ignore Link Here
1302
	const char *cmd, *cp = *cpp;
1302
	const char *cmd, *cp = *cpp;
1303
	char *cp2, **argv;
1303
	char *cp2, **argv;
1304
	int base = 0;
1304
	int base = 0;
1305
	long l;
1305
	long long ll;
1306
	int path1_mandatory = 0, i, cmdnum, optidx, argc;
1306
	int path1_mandatory = 0, i, cmdnum, optidx, argc;
1307
1307
1308
	/* Skip leading whitespace */
1308
	/* Skip leading whitespace */
Lines 1460-1475 parse_args(const char **cpp, int *ignore Link Here
1460
		if (argc - optidx < 1)
1460
		if (argc - optidx < 1)
1461
			goto need_num_arg;
1461
			goto need_num_arg;
1462
		errno = 0;
1462
		errno = 0;
1463
		l = strtol(argv[optidx], &cp2, base);
1463
		ll = strtoll(argv[optidx], &cp2, base);
1464
		if (cp2 == argv[optidx] || *cp2 != '\0' ||
1464
		if (cp2 == argv[optidx] || *cp2 != '\0' ||
1465
		    ((l == LONG_MIN || l == LONG_MAX) && errno == ERANGE) ||
1465
		    ((ll == LLONG_MIN || ll == LLONG_MAX) && errno == ERANGE) ||
1466
		    l < 0) {
1466
		    ll < 0 || ll > UINT32_MAX) {
1467
 need_num_arg:
1467
 need_num_arg:
1468
			error("You must supply a numeric argument "
1468
			error("You must supply a numeric argument "
1469
			    "to the %s command.", cmd);
1469
			    "to the %s command.", cmd);
1470
			return -1;
1470
			return -1;
1471
		}
1471
		}
1472
		*n_arg = l;
1472
		*n_arg = ll;
1473
		if (cmdnum == I_LUMASK)
1473
		if (cmdnum == I_LUMASK)
1474
			break;
1474
			break;
1475
		/* Get pathname (mandatory) */
1475
		/* Get pathname (mandatory) */

Return to bug 3206