]> git.tue.mpg.de Git - paraslash.git/commitdiff
ipc: Remove pointless initialization in shm_get_shmmax().
authorAndre Noll <maan@tuebingen.mpg.de>
Wed, 20 Mar 2024 22:32:24 +0000 (23:32 +0100)
committerAndre Noll <maan@tuebingen.mpg.de>
Tue, 7 May 2024 18:28:14 +0000 (20:28 +0200)
The subsequent read() call overwrites the buffer.

ipc.c

diff --git a/ipc.c b/ipc.c
index 8e9dd51a2369e7e60ebd4bda3fa889eaed892248..c245f690788630e19f2c7e82bda903360e1c0fa5 100644 (file)
--- a/ipc.c
+++ b/ipc.c
@@ -218,7 +218,7 @@ size_t shm_get_shmmax(void)
        {
                int fd = open("/proc/sys/kernel/shmmax", O_RDONLY);
                if (fd >= 0) {
-                       char buf[100] = "";
+                       char buf[100];
                        int ret = read(fd, buf, sizeof(buf) - 1);
                        if (ret > 0) {
                                buf[ret] = '\0';