]> git.lizzy.rs Git - plan9front.git/blobdiff - sys/src/libmemdraw/alloc.c
strndup: don't assume buffer is terminated
[plan9front.git] / sys / src / libmemdraw / alloc.c
index aa3597f71229a49e6dcf903fd399e90aa11374d1..0dba4503ff32dd8cb0d403de3a45f830c1ee252b 100644 (file)
@@ -143,8 +143,7 @@ byteaddr(Memimage *i, Point p)
 {
        uchar *a;
 
-       a = i->data->bdata+i->zero+sizeof(ulong)*p.y*i->width;
-
+       a = i->data->bdata+i->zero+(int)(sizeof(ulong)*p.y*i->width);
        if(i->depth < 8){
                /*
                 * We need to always round down,