From: Rory Y. <ror...@gm...> - 2014-02-27 15:17:47
|
Hi Yasuhiro, > Below is a patch. > Please check and include. > > https://gist.github.com/mattn/100bb84e2c5b5f54649d [from URL above:] > --- a/src/itdb_device.c > +++ b/src/itdb_device.c > @@ -1047,7 +1047,7 @@ gboolean itdb_device_read_sysinfo (Itdb_Device *device) > gchar *ptr; > gint len = strlen (buf); > /* suppress newline at end of line */ > - if ((len>0) && (buf[len-1]==0x0a)) > + if ((len>0) && (buf[len-1]==0x0a || buf[len-1]==0x0d)) I don't know what this data is for, but (going with the comment) shouldn't you strip newlines and carriage returns? So something like (untested): while(len>0 && (buf[len-1]==0x0a || buf[len-1]==0x0d)) { buf[len-1]=0; --len; } And, again speaking from ignorance: it's not clear why the fopen() on line 1041 of this file doesn't get the "rb" treatment like the other fopen() calls. Regards, Rory |