diff options
Diffstat (limited to 'src/sm_manager.c')
-rw-r--r-- | src/sm_manager.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/sm_manager.c b/src/sm_manager.c index 68cabcd..df9c221 100644 --- a/src/sm_manager.c +++ b/src/sm_manager.c @@ -1,3 +1,4 @@ +/* $XdotOrg: $ */ /* $Xorg: sm_manager.c,v 1.4 2001/02/09 02:03:30 xorgcvs Exp $ */ /* @@ -130,8 +131,12 @@ char *errorStringRet; if (!newClientProc) { - strncpy (errorStringRet, - "The SmsNewClientProc callback can't be NULL", errorLength); + if (errorStringRet && errorLength > 0) { + strncpy (errorStringRet, + "The SmsNewClientProc callback can't be NULL", + errorLength); + errorStringRet[errorLength - 1] = '\0'; + } return (0); } @@ -150,9 +155,12 @@ char *errorStringRet; NULL /* IceIOErrorProc */ )) < 0) { - strncpy (errorStringRet, - "Could not register XSMP protocol with ICE", errorLength); - + if (errorStringRet && errorLength > 0) { + strncpy (errorStringRet, + "Could not register XSMP protocol with ICE", + errorLength); + errorStringRet[errorLength - 1] = '\0'; + } return (0); } } |