Skip to content

Commit

Permalink
fix issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ablakely committed Nov 21, 2023
1 parent 595e90c commit d35de0a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@

#ifdef __STDC_VERSION__
#if __STDC_VERSION >= 199901L
#ifdef __USE_XOPEN2K
void strlcpy(char *to, const char *from, int len);
#endif
#endif
#endif

int numPlaces(int n);
float ctof(float c);
Expand Down
2 changes: 2 additions & 0 deletions src/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@

#ifdef __STDC_VERSION__
#if __STDC_VERSION >= 199901L
#ifdef __USE_XOPEN2K
void strlcpy(char *to, const char *from, int len)
{
memccpy(to, from, '\0', len);
to[len-1] = '\0';
}
#endif
#endif
#endif

int numPlaces(int n)
{
Expand Down

0 comments on commit d35de0a

Please sign in to comment.