summaryrefslogtreecommitdiffstats
path: root/src/cmd/acme/wind.c
diff options
context:
space:
mode:
authorNeven Sajko <nsajko@gmail.com>2016-05-28 15:00:06 +0200
committerDavid du Colombier <0intro@gmail.com>2020-01-02 21:47:07 +0100
commitd6f8c236b8c601781cef6f8521fd47dffa1758b4 (patch)
tree91f3650673ccc2f84d194bffcf7466d7d371a4e1 /src/cmd/acme/wind.c
parentf77d12f8d8a822aae41b835c0cca050928c58221 (diff)
downloadplan9port-d6f8c236b8c601781cef6f8521fd47dffa1758b4.tar.gz
plan9port-d6f8c236b8c601781cef6f8521fd47dffa1758b4.zip
acme: do not pass null pointers where disallowed
The C standards disallow passing null pointers to memmove and memcmp. Change-Id: I1c88c2adbc32a23ef742f206038b8f7c4e0540c7
Diffstat (limited to 'src/cmd/acme/wind.c')
-rw-r--r--src/cmd/acme/wind.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/cmd/acme/wind.c b/src/cmd/acme/wind.c
index 19b52f5c..b4f1a1cb 100644
--- a/src/cmd/acme/wind.c
+++ b/src/cmd/acme/wind.c
@@ -476,7 +476,8 @@ winsettag1(Window *w)
/* compute the text for the whole tag, replacing current only if it differs */
new = runemalloc(w->body.file->nname+100);
i = 0;
- runemove(new+i, w->body.file->name, w->body.file->nname);
+ if(w->body.file->nname != 0)
+ runemove(new, w->body.file->name, w->body.file->nname);
i += w->body.file->nname;
runemove(new+i, Ldelsnarf, 10);
i += 10;