shithub: riscv

Download patch

ref: e1548dc55a3459a7b746ec6734e0b5e16d0fbf8a
parent: 3005ae10b5ed92c258cbef1981e124dd92cc9e68
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sun Feb 9 07:42:04 EST 2025

jpg: don't put newline in sysfatal() or werrstr()

--- a/sys/src/cmd/jpg/readpng.c
+++ b/sys/src/cmd/jpg/readpng.c
@@ -486,7 +486,7 @@
 	err = inflatezlib(&zw, zwrite, &zr, zread);
 
 	if(err)
-		sysfatal("inflatezlib %s\n", flateerr(err));
+		sysfatal("inflatezlib %s", flateerr(err));
 
 	free(buf);
 	free(zw.scan);
--- a/sys/src/cmd/jpg/readtga.c
+++ b/sys/src/cmd/jpg/readtga.c
@@ -331,7 +331,7 @@
 	w = Dx(ar->r);
 	h = Dy(ar->r);
 	if((t = malloc(w)) == nil){
-		werrstr("ReadTGA: no memory - %r\n");
+		werrstr("ReadTGA: no memory - %r");
 		return -1;
 	}
 
@@ -410,12 +410,12 @@
 
 	array = nil;
 	if((ar = calloc(1, sizeof(Rawimage))) == nil){
-		werrstr("ReadTGA: no memory - %r\n");
+		werrstr("ReadTGA: no memory - %r");
 		goto Error;
 	}
 
 	if((array = calloc(2, sizeof(Rawimage *))) == nil){
-		werrstr("ReadTGA: no memory - %r\n");
+		werrstr("ReadTGA: no memory - %r");
 		goto Error;
 	}
 	array[0] = ar;
@@ -444,7 +444,7 @@
 	ar->r = Rect(0, 0, h->width, h->height);
 	for(c = 0; c < ar->nchans; c++)
 		if((ar->chans[c] = malloc(h->width*h->height)) == nil){
-			werrstr("ReadTGA: no memory - %r\n");
+			werrstr("ReadTGA: no memory - %r");
 			goto Error;
 		}
 	r = ar->chans[0];
@@ -473,12 +473,12 @@
 		n = luma_rle(bp, h->bpp, r, num);
 		break;
 	default:
-		werrstr("ReadTGA: type=%d (%s) unsupported\n", h->datatype, datatype[h->datatype]);
+		werrstr("ReadTGA: type=%d (%s) unsupported", h->datatype, datatype[h->datatype]);
 		goto Error;	
  	}
 
 	if(n != num){
-		werrstr("ReadTGA: decode fail (%d!=%d) - %r\n", n, num);
+		werrstr("ReadTGA: decode fail (%d!=%d) - %r", n, num);
 		goto Error;
 	}
 	if((h->descriptor&(1<<4)) != 0)
--- a/sys/src/cmd/jpg/readtif.c
+++ b/sys/src/cmd/jpg/readtif.c
@@ -1520,7 +1520,7 @@
 		readval = readlong;
 		break;
 	default:
-		werrstr("unsupported type\n");
+		werrstr("unsupported type");
 		return -1;
 	}
 	if((f->val = malloc(f->cnt*sizeof *f->val)) == nil)
--- a/sys/src/cmd/jpg/readv210.c
+++ b/sys/src/cmd/jpg/readv210.c
@@ -92,7 +92,7 @@
 	}
 
 	if(looksize("/lib/video.specs", sz, &pixels, &lines, &chunk) == -1){
-		werrstr("file spec not in /lib/video.specs\n");
+		werrstr("file spec not in /lib/video.specs");
 		return nil;
 	}
 
--