From e7e20fab1b2b90ea80e118959386017ed1d6f703 Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Sat, 19 Nov 2022 22:39:14 -0500 Subject: create function open_pathfmt() to allow printf formatting on open() save some space by allowing printf formatting directly rather than having a buffer and using sprintf Change-Id: I049c8f898fb4a68a26ad0f0646250c242647ba12 --- apps/talk.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'apps/talk.c') diff --git a/apps/talk.c b/apps/talk.c index 8507a89541..89319ae9a2 100644 --- a/apps/talk.c +++ b/apps/talk.c @@ -247,7 +247,6 @@ static struct buflib_callbacks talk_ops = { static int open_voicefile(void) { - char buf[64]; char* p_lang = DEFAULT_VOICE_LANG; /* default */ if ( global_settings.lang_file[0] && @@ -256,9 +255,7 @@ static int open_voicefile(void) p_lang = (char *)global_settings.lang_file; } - snprintf(buf, sizeof(buf), LANG_DIR "/%s.voice", p_lang); - - return open(buf, O_RDONLY); + return open_pathfmt(O_RDONLY, LANG_DIR "/%s.voice", p_lang); } -- cgit v1.2.3