X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=windows%2Fwinstore.c;h=76c73d096d5d89b946e0d3a67e8c75a2b8ffc6be;hb=c10a8dee07fc10cbe9295e1a088b15b6e357f774;hp=c1656762ee279ae81940a8121acd9d7e57bd02e5;hpb=9c75fe9a3fa5e6b709f1c210795d1140ca1be2e8;p=PuTTY.git diff --git a/windows/winstore.c b/windows/winstore.c index c1656762..76c73d09 100644 --- a/windows/winstore.c +++ b/windows/winstore.c @@ -230,21 +230,20 @@ void write_setting_fontspec(void *handle, const char *name, FontSpec *font) sfree(settingname); } -int read_setting_filename(void *handle, const char *name, Filename *result) +Filename *read_setting_filename(void *handle, const char *name) { char *tmp = read_setting_s(handle, name); if (tmp) { - strncpy(result->path, tmp, sizeof(result->path)-1); - result->path[sizeof(result->path)-1] = '\0'; + Filename *ret = filename_from_str(tmp); sfree(tmp); - return TRUE; + return ret; } else - return FALSE; + return NULL; } -void write_setting_filename(void *handle, const char *name, Filename result) +void write_setting_filename(void *handle, const char *name, Filename *result) { - write_setting_s(handle, name, result.path); + write_setting_s(handle, name, result->path); } void close_settings_r(void *handle)