fix clang warnings

This change fixes the following warnings:

cmd/wmii/div.c:80:6: warning: unsequenced modification and access to 'n'
cmd/wmii/message.c:231:7: warning: variable 'l' is used uninitialized whenever '&&' condition is false
cmd/wmii/message.c:240:7: warning: variable 'l' is used uninitialized whenever '&&' condition is false
This commit is contained in:
David du Colombier 2023-06-25 20:48:02 +02:00
parent c55871eab5
commit e720b28418
2 changed files with 4 additions and 1 deletions

View File

@ -77,7 +77,8 @@ drawimg(Image *img, Color cbg, Color cborder, Divide *d) {
pt[n++] = Pt(w - 1, w - 1);
pt[n++] = Pt(w - 1, Dy(img->r));
pt[n++] = Pt(w, pt[n-1].y);
pt[n] = Pt(w, pt[n-1].y);
n++;
pt[n++] = Pt(w, w - 1);
pt[n++] = Pt(2*w - 1, 0);

View File

@ -228,6 +228,7 @@ static ulong
msg_getulong(const char *s) {
ulong l;
l = 0;
if(!(s && getulong(s, &l)))
error(Ebadvalue);
return l;
@ -237,6 +238,7 @@ static long
msg_getlong(const char *s) {
long l;
l = 0;
if(!(s && getlong(s, &l)))
error(Ebadvalue);
return l;