summaryrefslogtreecommitdiff
path: root/riscos/query.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2010-04-24 21:25:08 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2010-04-24 21:25:08 +0000
commit023167651aa8b25d29b8d7f3d4a633fcaa9193f0 (patch)
treef277260fe4931b71994ab251b75d1aeed2ba73b6 /riscos/query.c
parent4c4c2c5f97a13e3b584a5176c457efb6d6a51e1a (diff)
downloadnetsurf-023167651aa8b25d29b8d7f3d4a633fcaa9193f0.tar.gz
netsurf-023167651aa8b25d29b8d7f3d4a633fcaa9193f0.tar.bz2
Squash warnings in RISC OS build.
Replace use of strnlen with strlen and max. svn path=/trunk/netsurf/; revision=10479
Diffstat (limited to 'riscos/query.c')
-rw-r--r--riscos/query.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/riscos/query.c b/riscos/query.c
index 8a0087feb..6401ad2b8 100644
--- a/riscos/query.c
+++ b/riscos/query.c
@@ -20,6 +20,7 @@
#include <string.h>
#include <stdbool.h>
+
#include "riscos/dialog.h"
#include "riscos/query.h"
#include "riscos/wimp.h"
@@ -177,8 +178,8 @@ query_id query_user_xy(const char *query, const char *detail,
}
icn = &query_template->icons[ICON_QUERY_YES];
- len = strnlen(local_text ? local_text : yes,
- icn->data.indirected_text.size - 1);
+ len = strlen(local_text ? local_text : yes);
+ len = max(len, icn->data.indirected_text.size - 1);
memcpy(icn->data.indirected_text.text,
local_text ? local_text: yes, len);
icn->data.indirected_text.text[len] = '\0';
@@ -207,8 +208,8 @@ query_id query_user_xy(const char *query, const char *detail,
}
icn = &query_template->icons[ICON_QUERY_NO];
- len = strnlen(local_text ? local_text : no,
- icn->data.indirected_text.size - 1);
+ len = strlen(local_text ? local_text : no);
+ len = max(len, icn->data.indirected_text.size - 1);
memcpy(icn->data.indirected_text.text,
local_text ? local_text : no, len);
icn->data.indirected_text.text[len] = '\0';