From afb944d4c0f032fc9a653eb5bf96d2f6540bf8fe Mon Sep 17 00:00:00 2001 From: reimar Date: Tue, 8 Jan 2008 22:18:35 +0000 Subject: [PATCH] Simplify a needlessly complex use of snprintf git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25652 b3059339-0415-0410-9bf9-f77b7e298cf2 --- mplayer.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mplayer.c b/mplayer.c index a954b60bba..be7b58d7a7 100644 --- a/mplayer.c +++ b/mplayer.c @@ -781,8 +781,7 @@ static void exit_sighandler(int x){ if (crash_debug) { int gdb_pid; char spid[20]; - snprintf(spid, 19, "%i", getpid()); - spid[19] = 0; + snprintf(spid, sizeof(spid), "%i", getpid()); mp_msg(MSGT_CPLAYER, MSGL_INFO, "Forking...\n"); gdb_pid = fork(); mp_msg(MSGT_CPLAYER, MSGL_INFO, "Forked...\n");