diff --git a/usr.bin/m4/main.c b/usr.bin/m4/main.c index 722fc92eb8f6..a1cf0657638d 100644 --- a/usr.bin/m4/main.c +++ b/usr.bin/m4/main.c @@ -204,6 +204,8 @@ main(int argc, char *argv[]) for (p = optarg; *p; p++) if (*p == '=') break; + if (p == optarg) + errx(1, "null variable cannot be defined"); if (*p) *p++ = EOS; dodefine(optarg, p);