diff options
| author | Dan Cross <cross@gajendra.net> | 2025-07-24 14:22:18 +0000 |
|---|---|---|
| committer | Dan Cross <cross@gajendra.net> | 2025-07-24 15:45:31 +0000 |
| commit | 4089e29e89026f0b581155987d5f683d7635fd13 (patch) | |
| tree | 168b0306e87f3a7c1c42f81e656cf0054add7371 /src/libplumb | |
| parent | 564d45b5a55adeb48f69fdecb2bf4ed1f909850b (diff) | |
| download | plan9port-4089e29e89026f0b581155987d5f683d7635fd13.tar.gz plan9port-4089e29e89026f0b581155987d5f683d7635fd13.zip | |
warnings: fix warnings on newer compilers
Mostly turning the crank on fixing simple warnings: arrays, for
instance, can never be nil. A couple of pointers should have been
initialized to `nil` before being tested.
Some logic in `troff` was simplified: basically, an `if` statement had
a condition that must have always been true if that section of code
were being executed at all.
Diffstat (limited to 'src/libplumb')
| -rw-r--r-- | src/libplumb/mesg.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libplumb/mesg.c b/src/libplumb/mesg.c index acc0ac32..d528032f 100644 --- a/src/libplumb/mesg.c +++ b/src/libplumb/mesg.c @@ -304,9 +304,11 @@ plumbunpackpartial(char *buf, int n, int *morep) i = plumbline(&m->dst, buf, i, n, &bad); i = plumbline(&m->wdir, buf, i, n, &bad); i = plumbline(&m->type, buf, i, n, &bad); + attr = nil; i = plumbline(&attr, buf, i, n, &bad); m->attr = plumbunpackattr(attr); free(attr); + ntext = nil; i = plumbline(&ntext, buf, i, n, &bad); m->ndata = atoi(ntext); if(m->ndata != n-i){ |
