diff options
author | Nanang Izzuddin <nanang@teluu.com> | 2014-05-23 09:29:09 +0000 |
---|---|---|
committer | Nanang Izzuddin <nanang@teluu.com> | 2014-05-23 09:29:09 +0000 |
commit | 68af0002af7d7afe2128a94a59c19ffd63c7173f (patch) | |
tree | e9a98784df1141d6f3fdc29d67ba0be783e2ac7a /pjsip-apps | |
parent | 591a02ee40619fe006f516816735480940eed869 (diff) |
Misc (re #1751): Fixed uninitialized config filename in ui_write_settings() in pjsua app (thanks Lars Helgeson for the report).
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4851 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip-apps')
-rw-r--r-- | pjsip-apps/src/pjsua/pjsua_app_legacy.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/pjsip-apps/src/pjsua/pjsua_app_legacy.c b/pjsip-apps/src/pjsua/pjsua_app_legacy.c index 0e9333ef..ed960e30 100644 --- a/pjsip-apps/src/pjsua/pjsua_app_legacy.c +++ b/pjsip-apps/src/pjsua/pjsua_app_legacy.c @@ -1613,11 +1613,10 @@ static void ui_dump_configuration() len, settings)); } -static void ui_write_settings() +static void ui_write_settings(const char *filename) { char settings[2000]; int len; - char buf[128]; len = write_settings(&app_config, settings, sizeof(settings)); if (len < 1) @@ -1626,7 +1625,7 @@ static void ui_write_settings() pj_oshandle_t fd; pj_status_t status; - status = pj_file_open(app_config.pool, buf, PJ_O_WRONLY, &fd); + status = pj_file_open(app_config.pool, filename, PJ_O_WRONLY, &fd); if (status != PJ_SUCCESS) { pjsua_perror(THIS_FILE, "Unable to open file", status); } else { @@ -1634,7 +1633,7 @@ static void ui_write_settings() pj_file_write(fd, settings, &size); pj_file_close(fd); - printf("Settings successfully written to '%s'\n", buf); + printf("Settings successfully written to '%s'\n", filename); } } } @@ -1907,7 +1906,7 @@ void legacy_main() case 'f': if (simple_input("Enter output filename", buf, sizeof(buf))) { - ui_write_settings(); + ui_write_settings(buf); } break; |