use strnul(); optimise

This commit is contained in:
tg
2017-04-29 22:04:31 +00:00
parent f2de19c41f
commit e6395046df
8 changed files with 31 additions and 30 deletions

4
var.c
View File

@@ -28,7 +28,7 @@
#include <sys/sysctl.h>
#endif
__RCSID("$MirOS: src/bin/mksh/var.c,v 1.216 2017/04/27 19:33:53 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/var.c,v 1.217 2017/04/29 22:04:31 tg Exp $");
/*-
* Variables
@@ -464,7 +464,7 @@ setstr(struct tbl *vq, const char *s, int error_ok)
#ifndef MKSH_SMALL
/* debugging */
if (s >= vq->val.s &&
s <= vq->val.s + strlen(vq->val.s)) {
s <= strnul(vq->val.s)) {
internal_errorf(
"setstr: %s=%s: assigning to self",
vq->name, s);