repo: rxvt-unicode-sixel
action: commit
revision: 
path_from: 
revision_from: 4545ce5fbe5111caa524a9c872a36ee75b62cb01:
path_to: 
revision_to: 
git.thebackupbox.net
rxvt-unicode-sixel
git clone git://git.thebackupbox.net/rxvt-unicode-sixel
commit 4545ce5fbe5111caa524a9c872a36ee75b62cb01
Author: Emanuele Giaquinta 
Date:   Wed Jun 27 20:26:15 2007 +0000

    strndup is not portable.

diff --git a/src/xpm.C b/src/xpm.C
index ed4ae08733e4da20170e1015e33ec7c6178cdecc..
index ..9f81373f8d352f05c38f07840c3c033dba9f4db5 100644
--- a/src/xpm.C
+++ b/src/xpm.C
@@ -412,7 +412,10 @@ rxvt_term::set_bgPixmap (const char *file)
         original_asim = get_asimage( asimman, file, 0xFFFFFFFF, 100 ); 	  
       else
         {
-          f = strndup( file, f - file );
+          size_t len = f - file;
+          f = (char *)malloc (len + 1);
+          strncpy (f, file, len);
+          f[len] = '\0';
           original_asim = get_asimage( asimman, f, 0xFFFFFFFF, 100 ); 	  
           free( f );
         }

-----END OF PAGE-----