From: ayin Date: Wed, 27 Jun 2007 20:26:15 +0000 (+0000) Subject: strndup is not portable. X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=39351e9ebcd46244df4f42c40f2a6ef540598083;p=dana%2Furxvt.git strndup is not portable. --- diff --git a/src/xpm.C b/src/xpm.C index ed4ae087..9f81373f 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 ); }