[MPlayer-cvslog] CVS: main mp_msg.c,1.36,1.37

Alban Bedel CVS syncmail at mplayerhq.hu
Fri Mar 24 03:31:31 CET 2006


CVS change done by Alban Bedel CVS

Update of /cvsroot/mplayer/main
In directory mail:/var2/tmp/cvs-serv20811

Modified Files:
	mp_msg.c 
Log Message:
The fix in mp_msg.c avoids a core dump when iconv_open() fails, the other
just makes it possible to compile if USE_ICONV is undefined.

Patch by Bjorn Sandell (biorn _At_ chalmers _Dot_ se).


Index: mp_msg.c
===================================================================
RCS file: /cvsroot/mplayer/main/mp_msg.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- mp_msg.c	8 Mar 2006 12:45:47 -0000	1.36
+++ mp_msg.c	24 Mar 2006 02:31:29 -0000	1.37
@@ -102,6 +102,10 @@
         msgiconv = iconv_open(mp_msg_charset, MSG_CHARSET);
         old_charset = strdup(mp_msg_charset);
       }
+      if (msgiconv == (iconv_t)(-1)) {
+        fprintf(stderr,"iconv: conversion from %s to %s unsupported\n"
+               ,mp_msg_charset,MSG_CHARSET);
+      }else{
       memset(tmp2, 0, MSGSIZE_MAX);
       while (iconv(msgiconv, &in, &inlen, &out, &outlen) == -1) {
         if (!inlen || !outlen)
@@ -112,6 +116,7 @@
       strncpy(tmp, tmp2, MSGSIZE_MAX);
       tmp[MSGSIZE_MAX-1] = 0;
       tmp[MSGSIZE_MAX-2] = '\n';
+      }
     }
 #endif
 




More information about the MPlayer-cvslog mailing list