};
if (a_gid != NULL) {
- if (strspn(a_gid->val, "0123456789") != strlen(a_gid->val))
+ const char *teststr;
+ teststr = a_gid->val;
+ if (*teststr == '-')
+ teststr++;
+ if (strspn(teststr, "0123456789") != strlen(teststr))
errx(EX_USAGE, "-g expects a number");
}