aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/acme
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/acme')
-rw-r--r--src/cmd/acme/util.c2
-rw-r--r--src/cmd/acme/wind.c3
2 files changed, 4 insertions, 1 deletions
diff --git a/src/cmd/acme/util.c b/src/cmd/acme/util.c
index d694634f..dc978095 100644
--- a/src/cmd/acme/util.c
+++ b/src/cmd/acme/util.c
@@ -276,6 +276,8 @@ runeeq(Rune *s1, uint n1, Rune *s2, uint n2)
{
if(n1 != n2)
return FALSE;
+ if(n1 == 0)
+ return TRUE;
return memcmp(s1, s2, n1*sizeof(Rune)) == 0;
}
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;