shithub: riscv

Download patch

ref: 455a0a09acbe2c0e480a4df853ad1c461542e76d
parent: 796e7b84bd7a49b97d3e592b4b7537c4ed096457
author: BurnZeZ <brz-9dev@feline.systems>
date: Wed Apr 6 16:22:42 EDT 2016

jpg: fd == 0 is valid, so don't ignore it

--- a/sys/src/cmd/jpg/jpg.c
+++ b/sys/src/cmd/jpg/jpg.c
@@ -125,7 +125,7 @@
 
 	if(yflag==0 && dflag==0 && colorspace==CYCbCr){	/* see if we should convert right to RGB */
 		fd = open("/dev/screen", OREAD);
-		if(fd > 0){
+		if(fd >= 0){
 			buf[12] = '\0';
 			if(read(fd, buf, 12)==12 && chantodepth(strtochan(buf))>8)
 				colorspace = CRGB;