]> git.alsa-project.org Git - alsa-lib.git/commitdiff
control: shm - initialize write buffer
authorJaroslav Kysela <perex@perex.cz>
Thu, 5 May 2022 12:37:52 +0000 (14:37 +0200)
committerJaroslav Kysela <perex@perex.cz>
Thu, 5 May 2022 12:38:09 +0000 (14:38 +0200)
  ccontrol_shm.c: In function ‘snd_ctl_shm_action’:
  control_shm.c:54:23: error: invalid initializer
     54 |         char buf[1] = 0;
        |                       ^

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
src/control/control_shm.c

index c5723549367bdc41a57147241b4f2d66b8f570e5..d7297e6cbf1f689ab882e0d0bdf60221883b4ef0 100644 (file)
@@ -51,7 +51,7 @@ static int snd_ctl_shm_action(snd_ctl_t *ctl)
 {
        snd_ctl_shm_t *shm = ctl->private_data;
        int err;
-       char buf[1];
+       char buf[1] = {0};
        volatile snd_ctl_shm_ctrl_t *ctrl = shm->ctrl;
        err = write(shm->socket, buf, 1);
        if (err != 1)