Skip to content

Commit

Permalink
Include <string.h> in shmem.c for strncpy()
Browse files Browse the repository at this point in the history
Fixes the below error:

> clang-17: warning: argument unused during compilation: '-shared' [-Wunused-command-line-argument]
> shmem.c:130:2: error: call to undeclared library function 'strncpy' with type 'char *(char *, const char *, unsigned long)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
> strncpy(name_buffer, name, sizeof(name_buffer));
  • Loading branch information
fornwall committed May 14, 2024
1 parent 447caef commit 2fb093b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions shmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
#include <sys/socket.h>
#include <sys/un.h>
Expand Down

0 comments on commit 2fb093b

Please sign in to comment.