diff --git a/sh.h b/sh.h index 4c95582..daceb90 100644 --- a/sh.h +++ b/sh.h @@ -150,7 +150,7 @@ #endif #ifdef EXTERN -__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.377 2010/01/28 15:13:25 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.378 2010/01/28 20:26:51 tg Exp $"); #endif #define MKSH_VERSION "R39 2010/01/08" @@ -1624,7 +1624,8 @@ char *str_val(struct tbl *); int setstr(struct tbl *, const char *, int); struct tbl *setint_v(struct tbl *, struct tbl *, bool); void setint(struct tbl *, mksh_ari_t); -struct tbl *typeset(const char *, Tflag, Tflag, int, int); +struct tbl *typeset(const char *, Tflag, Tflag, int, int) + MKSH_A_NONNULL((nonnull (1))); void unset(struct tbl *, int); const char *skip_varname(const char *, int); const char *skip_wdvarname(const char *, int); diff --git a/var.c b/var.c index 1724e18..3a8052a 100644 --- a/var.c +++ b/var.c @@ -22,7 +22,7 @@ #include "sh.h" -__RCSID("$MirOS: src/bin/mksh/var.c,v 1.103 2010/01/25 14:38:04 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/var.c,v 1.104 2010/01/28 20:26:52 tg Exp $"); /* * Variables @@ -680,6 +680,8 @@ typeset(const char *var, Tflag set, Tflag clr, int field, int base) val = skip_varname(var, false); if (val == var) return (NULL); + mkssert(var != NULL); + mkssert(*var != 0); if (*val == '[') { if (set_refflag) errorf("%s: reference variable cannot be an array",