winecfg: prevent crash when clearing volume serial number input

Joerg-Cyril.Hoehle at Joerg-Cyril.Hoehle at
Thu Dec 18 07:47:37 CST 2008


[resend #1, apparently needs subscription to list or mail is silently dropped?!]

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.

Additional thoughts:
- 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'
Looks like

	Jörg Höhle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: winecfg-serial-number.patch
Type: application/octet-stream
Size: 2421 bytes
Desc: winecfg-serial-number.patch
Url : 

More information about the wine-patches mailing list