silence a gcc-4.2 warning and, in doing so, save quite a few operations:
• a NUL termination • a strlen() • a pointer comparision • eventually a function call replaced by • a pointer subtraction
This commit is contained in:
parent
77e27b9656
commit
18804b3555
5
misc.c
5
misc.c
@ -6,7 +6,7 @@
|
|||||||
#include <grp.h>
|
#include <grp.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.59 2007/07/01 16:49:17 tg Exp $\t"
|
__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.60 2007/07/01 22:17:29 tg Exp $\t"
|
||||||
MKSH_SH_H_ID);
|
MKSH_SH_H_ID);
|
||||||
|
|
||||||
#undef USE_CHVT
|
#undef USE_CHVT
|
||||||
@ -220,8 +220,7 @@ getoptions(void)
|
|||||||
for (i = 0; i < NELEM(options); i++)
|
for (i = 0; i < NELEM(options); i++)
|
||||||
if (options[i].c && Flag(i))
|
if (options[i].c && Flag(i))
|
||||||
*cp++ = options[i].c;
|
*cp++ = options[i].c;
|
||||||
*cp = 0;
|
return (str_nsave(m, cp - m, ATEMP));
|
||||||
return str_save(m, ATEMP);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* change a Flag(*) value; takes care of special actions */
|
/* change a Flag(*) value; takes care of special actions */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user