From 18804b355559dfaaa0d1e0f18b13ed9975dd5489 Mon Sep 17 00:00:00 2001 From: tg Date: Sun, 1 Jul 2007 22:17:29 +0000 Subject: [PATCH] =?UTF-8?q?silence=20a=20gcc-4.2=20warning=20and,=20in=20d?= =?UTF-8?q?oing=20so,=20save=20quite=20a=20few=20operations:=20=E2=80=A2?= =?UTF-8?q?=20a=20NUL=20termination=20=E2=80=A2=20a=20strlen()=20=E2=80=A2?= =?UTF-8?q?=20a=20pointer=20comparision=20=E2=80=A2=20eventually=20a=20fun?= =?UTF-8?q?ction=20call=20replaced=20by=20=E2=80=A2=20a=20pointer=20subtra?= =?UTF-8?q?ction?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- misc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/misc.c b/misc.c index 88cf973..ad6815d 100644 --- a/misc.c +++ b/misc.c @@ -6,7 +6,7 @@ #include #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); #undef USE_CHVT @@ -220,8 +220,7 @@ getoptions(void) for (i = 0; i < NELEM(options); i++) if (options[i].c && Flag(i)) *cp++ = options[i].c; - *cp = 0; - return str_save(m, ATEMP); + return (str_nsave(m, cp - m, ATEMP)); } /* change a Flag(*) value; takes care of special actions */