Skip to content

Commit

Permalink
handle null string
Browse files Browse the repository at this point in the history
  • Loading branch information
yohanes committed Apr 8, 2024
1 parent 55c8b4e commit 8bf9fdd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/src/main/cpp/native-lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ void *my_dlopen(const char *filename, int flags)
}

static void send_string(int fd, const char *str) {
int len = strlen(str);
int len = 0;
if (str) {
len = strlen(str);
}
write(fd, &len, sizeof(len));
write(fd, str, len);
}
Expand Down

0 comments on commit 8bf9fdd

Please sign in to comment.