diff options
| author | Arusekk <floss@arusekk.pl> | 2025-10-09 08:48:35 +0200 |
|---|---|---|
| committer | Dan Cross <crossd@gmail.com> | 2025-10-09 09:29:12 -0400 |
| commit | 00754b35a22d491b614fefe5149bcedad1523ef2 (patch) | |
| tree | 5979e4d44c3e49c78de7f69c8541a55127a7f044 | |
| parent | 80b782985479bfbc53ec269076a64bd34a921fe2 (diff) | |
devdraw: fix dangling else
Because of a dangling else, after adding a name to an image with 'N',
it was immediately deleted, resulting in Enoname in response to 'n'.
This went mostly unnoticed, since plan9port itself does not use named
images, but it can break external applications like truedraw[1].
[1]: https://git.sr.ht/~arusekk/truedraw
Fixes: c66b52501b63 ("new draw server")
| -rw-r--r-- | src/cmd/devdraw/devdraw.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cmd/devdraw/devdraw.c b/src/cmd/devdraw/devdraw.c index 234cdf1b..fe02dc8c 100644 --- a/src/cmd/devdraw/devdraw.c +++ b/src/cmd/devdraw/devdraw.c @@ -1107,10 +1107,10 @@ draw_datawrite(Client *client, void *v, int n) goto Enodrawimage; if(di->name) goto Enamed; - if(c) + if(c){ if(drawaddname(client, di, j, (char*)a+7, &err) < 0) goto error; - else{ + }else{ dn = drawlookupname(client, j, (char*)a+7); if(dn == nil) goto Enoname; |