rewrite XPtrV to use size_t instead of pointer arithmetic, for gcc-snapshot (20120930-1) -fstrict-overflow -Wstrict-overflow=9

This commit is contained in:
tg
2012-10-03 15:50:32 +00:00
parent 167995da22
commit 0575d07671
3 changed files with 35 additions and 31 deletions

4
syn.c
View File

@@ -23,7 +23,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/syn.c,v 1.80 2012/08/17 18:34:25 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/syn.c,v 1.81 2012/10/03 15:50:32 tg Exp $");
extern void yyskiputf8bom(void);
@@ -319,7 +319,7 @@ get_command(int cf)
ACCEPT;
/* manipulate the vars string */
tcp = *(--vars.cur);
tcp = XPptrv(vars)[(vars.len = 0)];
/* 'varname=' -> 'varname' */
tcp[wdscan(tcp, EOS) - tcp - 3] = EOS;