Fix usage of xstrncpy
[sxemacs] / lib-src / gnuserv.c
index 08649b7..05a33e9 100644 (file)
@@ -193,9 +193,7 @@ handle_ipc_request(struct msgbuf *msgp)
        }
        /* if */
        msgctl(ipc_qid, IPC_STAT, &msg_st);
-       xstrncpy(buf, msgp->mtext, len);
-       /* terminate buf */
-       buf[len] = '\0';
+       xstrncpy(buf, msgp->mtext, sizeof(buf));
 
        printf("%d %s", ipc_qid, buf);
        fflush(stdout);