Was not properly testing for error in fdport_write_substring's call to
fwrite().
This commit is contained in:
		
							parent
							
								
									18e8530076
								
							
						
					
					
						commit
						33e3bc8c62
					
				|  | @ -394,8 +394,9 @@ int read_fdport_substring(scheme_value buf, int start, int end, scheme_value dat | ||||||
| int write_fdport_substring(scheme_value buf, int start, int end, scheme_value data) | int write_fdport_substring(scheme_value buf, int start, int end, scheme_value data) | ||||||
| { | { | ||||||
|     FILE *f = fstar_cache[EXTRACT_FIXNUM(*PortData_Fd(data))]; |     FILE *f = fstar_cache[EXTRACT_FIXNUM(*PortData_Fd(data))]; | ||||||
|     int retval = fwrite(StrByte(buf,start), 1, end-start, f); |     int nbytes = end - start; | ||||||
|     return ferror(f) ? -1 : retval; /* -1: error, 0: eof */ |     int retval = fwrite(StrByte(buf,start), 1, nbytes, f); | ||||||
|  |     return (retval < nbytes) ? -1 : retval; /* -1: error, otw numwritten */ | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| /* 1st return value says why we terminated the read:
 | /* 1st return value says why we terminated the read:
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	 shivers
						shivers