summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mplayer.c3
1 files changed, 1 insertions, 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");