changeset 25624:7703675af42d

Simplify a needlessly complex use of snprintf
author reimar
date Tue, 08 Jan 2008 22:18:35 +0000
parents b955a135e3a8
children 501847ab4460
files mplayer.c
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mplayer.c	Tue Jan 08 21:40:44 2008 +0000
+++ b/mplayer.c	Tue Jan 08 22:18:35 2008 +0000
@@ -781,8 +781,7 @@
       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");