thanks to the nice property of my reimplementation of getn to also
return a value in case of an error (0 or the partial result, which is the full result in case of trailing junk even), using it to rid atoi() is possible, saving 9t 4d 1i
This commit is contained in:
4
exec.c
4
exec.c
@@ -2,7 +2,7 @@
|
||||
|
||||
#include "sh.h"
|
||||
|
||||
__RCSID("$MirOS: src/bin/mksh/exec.c,v 1.17 2006/11/10 01:44:39 tg Exp $");
|
||||
__RCSID("$MirOS: src/bin/mksh/exec.c,v 1.18 2006/11/10 04:03:58 tg Exp $");
|
||||
|
||||
static int comexec(struct op *, struct tbl *volatile, char **,
|
||||
int volatile);
|
||||
@@ -1216,7 +1216,7 @@ do_selectargs(char **ap, bool print_menu)
|
||||
return NULL;
|
||||
s = str_val(global("REPLY"));
|
||||
if (*s) {
|
||||
i = atoi(s);
|
||||
getn(s, &i);
|
||||
return (i >= 1 && i <= argct) ? ap[i - 1] : null;
|
||||
}
|
||||
print_menu = 1;
|
||||
|
Reference in New Issue
Block a user