HANDLE hFile;
filename[0] = letter;
- WINE_TRACE("Putting serial number of %08x into file '%s'\n", serial, filename);
+ WINE_TRACE("Putting serial number of %08X into file '%s'\n", serial, filename);
hFile = CreateFile(filename, GENERIC_WRITE, FILE_SHARE_READ, NULL,
CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile != INVALID_HANDLE_VALUE)
char *serial;
serial = get_text(dialog, id);
- current_drive->serial = strtoul( serial, NULL, 16 );
+ current_drive->serial = serial ? strtoul( serial, NULL, 16 ) : 0;
+ HeapFree(GetProcessHeap(), 0, serial);
current_drive->modified = TRUE;
- WINE_TRACE("set serial to %08x\n", current_drive->serial);
+ WINE_TRACE("set serial to %08X\n", current_drive->serial);
/* enable the apply button */
SendMessage(GetParent(dialog), PSM_CHANGED, (WPARAM) dialog, 0);
current_drive->label = str;
str = get_textW(dialog, IDC_EDIT_SERIAL);
- current_drive->serial = strtoulW( str, NULL, 16 );
+ current_drive->serial = str ? strtoulW( str, NULL, 16 ) : 0;
+ HeapFree(GetProcessHeap(), 0, str);
current_drive->modified = TRUE;
/* TODO: we don't have a device at this point */