AmendHub

Download:

jcs

/

amend

/

amendments

/

72

settings: Remove left over resource file switching in settings_save

Fixes crash

jcs made amendment 72 over 2 years ago
--- settings.c Tue Jan 11 20:37:06 2022 +++ settings.c Wed Jun 15 09:13:11 2022 @@ -47,7 +47,6 @@ settings_save(void) { Handle res; size_t l; - short cur_res; char tmp[8]; res = xGetResource('STR ', STR_AUTHOR_ID); @@ -72,8 +71,6 @@ settings_save(void) ChangedResource(res); WriteResource(res); ReleaseResource(res); - - UseResFile(cur_res); } void @@ -120,17 +117,17 @@ settings_edit(void) GetDItem(dlg, SETTINGS_AUTHOR_ID, &itype, &ihandle, &irect); GetIText(ihandle, txt); PtoCstr(txt); - if (strlen((char *)txt) >= sizeof(settings.author)) { + if (strlen((char *)&txt) >= sizeof(settings.author)) { warn("Author setting is too long (%ld max)", sizeof(settings.author) - 1); goto done; } - memcpy(settings.author, txt, strlen((char *)txt) + 1); + memcpy(settings.author, txt, strlen((char *)&txt) + 1); GetDItem(dlg, SETTINGS_TABWIDTH_ID, &itype, &ihandle, &irect); GetIText(ihandle, txt); PtoCstr(txt); - tabwidth = atoi((char *)txt); + tabwidth = atoi((char *)&txt); HUnlock(ihandle); if (tabwidth != settings.tabwidth) { warn("Restart Amend for new tabwidth setting to take effect");