summaryrefslogtreecommitdiff
path: root/frontends/riscos/window.c
diff options
context:
space:
mode:
authorJohn-Mark Bell <jmb@netsurf-browser.org>2022-06-03 02:39:30 +0100
committerJohn-Mark Bell <jmb@netsurf-browser.org>2022-06-03 02:39:30 +0100
commit617c6207bcd45daa8d66c35dbc4f1273686646f3 (patch)
tree2ff5f6fe5e713978201373265d78950018bd6709 /frontends/riscos/window.c
parent0d114e10b23548ae8b5a6af6a5d47bf71651080e (diff)
downloadnetsurf-617c6207bcd45daa8d66c35dbc4f1273686646f3.tar.gz
netsurf-617c6207bcd45daa8d66c35dbc4f1273686646f3.tar.bz2
RISC OS: fix up use of strncpy
Ensure that strings copied using strncpy are NUL terminated. Additionally, replace use of strncpy entirely where we are writing into non-indirected OS icon blocks (where an unterminated 12 character long string is perfectly valid).
Diffstat (limited to 'frontends/riscos/window.c')
-rw-r--r--frontends/riscos/window.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/frontends/riscos/window.c b/frontends/riscos/window.c
index 2c442ab2c..2b51c2fb9 100644
--- a/frontends/riscos/window.c
+++ b/frontends/riscos/window.c
@@ -3594,7 +3594,8 @@ static void gui_window_set_title(struct gui_window *g, const char *title)
title, scale_disp);
}
} else {
- strncpy(g->title, title, sizeof(g->title));
+ strncpy(g->title, title, sizeof(g->title) - 1);
+ g->title[sizeof(g->title)-1] = 0;
}
ro_gui_set_window_title(g->window, g->title);