Skip to content

Commit 9326db0

Browse files
committed
Apparently strlcpy is not available on al linux systems.
Reverted to the good old strncpy. Signed-off-by: Hans Dijkema <[email protected]>
1 parent 5bc3071 commit 9326db0

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/webui.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11819,14 +11819,15 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved) {
1181911819

1182011820
size_t s = strlen(webkit_uri) + 1;
1182111821
char *uri = (char *) _webui_malloc(s);
11822-
strlcpy(uri, webkit_uri, s);
11822+
strncpy(uri, webkit_uri, s - 1);
11823+
uri[s] = '\0';
1182311824

1182411825
char buf[20];
1182511826
snprintf(buf, 20, "%d", navigation_type);
1182611827
size_t nt_s = strlen(buf) + 1;
1182711828
char *type = (char *) _webui_malloc(nt_s);
11828-
strlcpy(type, buf, nt_s);
11829-
11829+
strncpy(uri, buf, nt_s - 1);
11830+
uri[nt_s] = '\0';
1183011831

1183111832
webui_event_inf_t* event_inf = NULL;
1183211833
size_t event_num = _webui_new_event_inf(win, &event_inf);

0 commit comments

Comments
 (0)