From: Romain <ro...@li...> - 2006-09-28 05:29:16
|
Hi Benjamin, > (1) libtifiles2 reports an error when a file has an invalid checksum. > That's nice, but (a) there are an *awful lot* of files out there that h= ave > perfectly good data and incorrect checksums -- TiLP itself has been kno= wn > to generate such files on occasion -- and (b) TiLP gives absolutely no > indication of the error, silently omitting the file and leaving the use= r > to wonder what is going on. I guess this was a problem before, but I o= nly > just noticed it. TiLP raises an error when file has an incorrect checksum except when drag= ged. I have disabled checksum verification. > (2) When I double-click on the device name, a lovely dialog box pops up > saying something along the lines of "Hardware Version: 1 / Boot Version= : > 1.0 / Os Version: 1.1 / Battery: good". ("OS" should be capitalized, b= ut done > that's not my main complaint.) The version numbers are truncated, beca= use > libticalcs2 does something like > > snprintf(infos->os_version, 4, "%1i.%02i", buf[0], buf[1]); > > which writes at most three characters plus a zero. > > This is actually a sign of a more serious problem. I'm guessing that t= he > reason nobody noticed this bug is that it was only tested on Windows. = As > it turns out, Microsoft's implementation of snprintf is non-standard (h= ey, > it's Microsoft, what do you expect?) -- in fact, if the formatted strin= g > is too long, Microsoft's snprintf won't null-terminate the result. > > This makes me extremely suspicious of all the other instances of snprin= tf > (82 in libticalcs2, 1 in libticables2, 11 in TiLP.) > > The simplest way to fix this is to use GLib's g_snprintf instead, which > conforms to C99 on all platforms (i.e., the result is null-terminated, = and > the return value is sensible.) ok > > Benjamin Moody > Thanks. > > -----------------------------------------------------------------------= -- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D= DEVDEV > _______________________________________________ > TiLP-devel mailing list > TiL...@li... > https://lists.sourceforge.net/lists/listinfo/tilp-devel > --=20 Romain Li=E9vin : <ro...@li...> Web site : http://www.lievin.net "Linux, y'a moins bien mais c'est plus cher !" |