diff options
author | Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> | 2008-11-29 04:55:58 -0200 |
---|---|---|
committer | Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> | 2008-11-29 04:55:58 -0200 |
commit | 1dcf5502137efe36d01b30169d4387438ad47be0 (patch) | |
tree | 0bac65e122f51c1be7c5f1643c9ecda60566d9a2 /src/sm_client.c | |
parent | 8bed01275a7c7caf8f777e4074a5ee1ba1c2b3e7 (diff) |
avoid gcc warnings for libSM
Patch from http://bugs.freedesktop.org/show_bug.cgi?id=17968 adapted
to current sources.
This corrects a potential (hypothetical) segmentation fault.
Diffstat (limited to 'src/sm_client.c')
-rw-r--r-- | src/sm_client.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/sm_client.c b/src/sm_client.c index 778a740..de79452 100644 --- a/src/sm_client.c +++ b/src/sm_client.c @@ -197,7 +197,9 @@ char *errorStringRet; * Now register the client */ - len = previousId ? strlen (previousId) : 0; + if (!previousId) + previousId = ""; + len = strlen (previousId); extra = ARRAY8_BYTES (len); IceGetHeaderExtra (iceConn, _SmcOpcode, SM_RegisterClient, @@ -263,7 +265,7 @@ char *errorStringRet; SIZEOF (smRegisterClientMsg), WORD64COUNT (extra), smRegisterClientMsg, pMsg, pData); - STORE_ARRAY8 (pData, 0, NULL); + STORE_ARRAY8 (pData, 0, ""); IceFlush (iceConn); |