Skip to content

Commit

Permalink
improve portability
Browse files Browse the repository at this point in the history
  • Loading branch information
sflow committed Aug 31, 2023
1 parent d64cd18 commit 3b1463a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Linux/readHidCounters.c
Expand Up @@ -22,7 +22,7 @@ extern "C" {
return NO;
}

int nlen = my_strnlen(uu.nodename, _UTSNAME_NODENAME_LENGTH);
int nlen = my_strnlen(uu.nodename, sizeof(uu.nodename));
if(nlen > hbufLen)
nlen = hbufLen;
memcpy(hbuf, uu.nodename, nlen);
Expand Down Expand Up @@ -78,7 +78,7 @@ extern "C" {
hid->os_name = SFLOS_linux;

// os release
int rlen = my_strnlen(uu.release, _UTSNAME_RELEASE_LENGTH);
int rlen = my_strnlen(uu.release, sizeof(uu.release));
if(rlen > rbufLen)
rlen = rbufLen;
memcpy(rbuf, uu.release, rlen);
Expand Down

0 comments on commit 3b1463a

Please sign in to comment.