[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[screen-devel] [PATCH 2/8] Process: Fix sign-compare errors
From: |
Kieran Bingham |
Subject: |
[screen-devel] [PATCH 2/8] Process: Fix sign-compare errors |
Date: |
Sun, 4 Oct 2015 16:52:27 +0100 |
DoProcess:
oldlen here is defined as a signed integer, with the lenp coming through
as a size_t (unsigned). Convert the local storage to size_t to match, and
allow the compiler to catch any further signed errors later
suFin:
Another len vs local store of len which hasn't been converted to size_t
In this use case, the local l takes the size of the char arrays in
struct inputsu, which are > 0, so this it should be reasonable
to set l as size_t.
Signed-off-by: Kieran Bingham <address@hidden>
---
src/process.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/process.c b/src/process.c
index 1bc204b..e443023 100644
--- a/src/process.c
+++ b/src/process.c
@@ -757,7 +757,7 @@ void ProcessInput2(char *ibuf, int ilen)
void DoProcess(Window *window, char **bufp, size_t *lenp, struct paster *pa)
{
- int oldlen;
+ size_t oldlen;
Display *d = display;
/* XXX -> PasteStart */
@@ -5226,7 +5226,7 @@ static void suFin(char *buf, size_t len, void *data)
{
struct inputsu *i = (struct inputsu *)data;
char *p;
- int l;
+ size_t l;
if (!*i->name) {
p = i->name;
--
2.1.4
- [screen-devel] [Trivial] Bugfixes and compiler warnings, Kieran Bingham, 2015/10/08
- [screen-devel] [PATCH 1/8] Makefile.in: Fix out of tree build, Kieran Bingham, 2015/10/08
- [screen-devel] [PATCH 2/8] Process: Fix sign-compare errors,
Kieran Bingham <=
- [screen-devel] [PATCH 3/8] Process: Fix const qualifer loss in ShowWindows, Kieran Bingham, 2015/10/08
- [screen-devel] [PATCH 5/8] Process: Fix printf modifier warning, Kieran Bingham, 2015/10/08
- [screen-devel] [PATCH 6/8] Display: Unsigned comparison causes unreachable code, Kieran Bingham, 2015/10/08
- [screen-devel] [PATCH 4/8] Process: Pointer arithmetic comparison with unsigned size_t, Kieran Bingham, 2015/10/08
- [screen-devel] [PATCH 7/8] Display: Convert strlen_onscreen to be unsigned like strlen, Kieran Bingham, 2015/10/08
- [screen-devel] [PATCH 8/8] WinMsgBuf: Fix const qualifier in wmbc_mergewmb, Kieran Bingham, 2015/10/08