diff options
Diffstat (limited to 'Gui/interface.c')
-rw-r--r-- | Gui/interface.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Gui/interface.c b/Gui/interface.c index 8778002c05..52c0ab3168 100644 --- a/Gui/interface.c +++ b/Gui/interface.c @@ -54,8 +54,12 @@ char * gstrcat( char ** dest,char * src ) if ( *dest ) { tmp=malloc( strlen( *dest ) + strlen( src ) + 1 ); - strcpy( tmp,*dest ); strcat( tmp,src ); free( *dest ); - } + + if ( tmp ) /* TODO: advanced error handling */ + { + strcpy( tmp,*dest ); strcat( tmp,src ); free( *dest ); + } + } else { tmp=malloc( strlen( src ) + 1 ); strcpy( tmp,src ); } *dest=tmp; |