winecfg: prevent crash when clearing volume serial number input
Joerg-Cyril.Hoehle at t-systems.com
Tue Dec 16 04:30:42 CST 2008
Attached is minor fix to A.Julliard's post 1.1.6 commit
winecfg: Store the drive serial number as a number instead of a string
strtoul(NULL) crashes. The former code was careful to special-case the NULL result from get_text(dialog) when the input field is emptied.
In addition, that commit leaks memory from get_text().
While I was at it, I changed logs to be consistent with the upper case serial number output written to .windows-serial.
Winecmd's DIR prints lower case, while ms-w2k DOS window's DIR prints upper case.
- Maybe the serial input field should be initialized with %08X instead of %X to hint at the format? E.g. input of serial numbers like "1122-dacf" as printed by DIR produce 00001122 in winecfg.
- Possibly the input size should be restricted to 8 characters in the GUI?
- Maybe winecfg should echo the number it read into the input field, no later than apply time. Currently one needs to select another driver, then come back to see what it got.
BTW, winecfg does not seem to be able to set .windows-label anymore:
warn:winecfg:set_drive_label unable to set volume label for devicename of L"E:\\", label of L"xyz"
trace:winecfg:PRINTERROR error: 'Access denied'
I'll add a bugzilla entry about it.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 2421 bytes
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20081216/db85de3b/attachment.obj
More information about the wine-patches