Set errno to 0 before strtoll() so that it can reliably be tested
afterwards. Fixes newfs_msdos at least on sparc. Incidentally, the msdosfs tests also start working on sparc, which about halves the number of test failures on that platform.
This commit is contained in:
parent
6315c7d63e
commit
d69295fda4
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: newfs_msdos.c,v 1.34 2009/04/11 06:59:18 lukem Exp $ */
|
/* $NetBSD: newfs_msdos.c,v 1.35 2011/03/05 13:47:43 pooka Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1998 Robert Nordier
|
* Copyright (c) 1998 Robert Nordier
|
||||||
@ -33,7 +33,7 @@
|
|||||||
static const char rcsid[] =
|
static const char rcsid[] =
|
||||||
"$FreeBSD: src/sbin/newfs_msdos/newfs_msdos.c,v 1.15 2000/10/10 01:49:37 wollman Exp $";
|
"$FreeBSD: src/sbin/newfs_msdos/newfs_msdos.c,v 1.15 2000/10/10 01:49:37 wollman Exp $";
|
||||||
#else
|
#else
|
||||||
__RCSID("$NetBSD: newfs_msdos.c,v 1.34 2009/04/11 06:59:18 lukem Exp $");
|
__RCSID("$NetBSD: newfs_msdos.c,v 1.35 2011/03/05 13:47:43 pooka Exp $");
|
||||||
#endif
|
#endif
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
@ -922,6 +922,7 @@ argtooff(const char *arg, const char *msg)
|
|||||||
char *s;
|
char *s;
|
||||||
off_t x;
|
off_t x;
|
||||||
|
|
||||||
|
errno = 0;
|
||||||
x = strtoll(arg, &s, 0);
|
x = strtoll(arg, &s, 0);
|
||||||
/* allow at most one extra char */
|
/* allow at most one extra char */
|
||||||
if (errno || x < 0 || (s[0] && s[1]) )
|
if (errno || x < 0 || (s[0] && s[1]) )
|
||||||
|
Loading…
Reference in New Issue
Block a user