diff options
author | Kurt Jaeger <pi@FreeBSD.org> | 2018-07-14 14:10:29 +0000 |
---|---|---|
committer | Kurt Jaeger <pi@FreeBSD.org> | 2018-07-14 14:10:29 +0000 |
commit | aed832b2a9e1556e6b98247ad6fb50585b81bd0b (patch) | |
tree | a37b188ef0029204ca784fa6924c5f1618f21d1e /net/xorp/files/patch-history.c | |
parent | a96dc6ab1898e95ebcf606ff2c9fdbb7888e2464 (diff) | |
download | ports-aed832b2a9e1556e6b98247ad6fb50585b81bd0b.tar.gz ports-aed832b2a9e1556e6b98247ad6fb50585b81bd0b.zip |
net/xorp: fix build
PR: 217152
Submitted by: Walter Schwarzenfeld <w.schwarzenfeld@utanet.at>
Reported by: O. Hartmann <ohartmann@walstatt.org>
Approved by: hrs (maintainer timeout)
Notes
Notes:
svn path=/head/; revision=474640
Diffstat (limited to 'net/xorp/files/patch-history.c')
-rw-r--r-- | net/xorp/files/patch-history.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/net/xorp/files/patch-history.c b/net/xorp/files/patch-history.c new file mode 100644 index 000000000000..3f12f88f1359 --- /dev/null +++ b/net/xorp/files/patch-history.c @@ -0,0 +1,48 @@ +--- cli/libtecla/history.c.orig 2018-07-11 18:08:59 UTC ++++ cli/libtecla/history.c +@@ -253,7 +253,7 @@ int _glh_add_history(GlHistory *glh, con + /* + * If the line is too big to fit in the buffer, truncate it. + */ +- if(nchar > glh->buflen) ++ if((unsigned long)(nchar) > glh->buflen) + nchar = glh->buflen; + /* + * Is the line empty? +@@ -272,7 +272,7 @@ int _glh_add_history(GlHistory *glh, con + * don't add it again, unless explicitly told to. + */ + if(!force && +- list->tail && strlen(glh->buffer + list->tail->start) == nchar-1 && ++ list->tail && strlen(glh->buffer + list->tail->start) == (unsigned long)((nchar-1)) && + strncmp(line, glh->buffer + list->tail->start, nchar-1)==0) + return 0; + /* +@@ -311,7 +311,7 @@ int _glh_add_history(GlHistory *glh, con + * at the end of the buffer, then shift the remaining contents + * of the buffer to the end of the buffer. + */ +- if(start + nchar >= glh->buflen) { ++ if(start + (unsigned long)(nchar) >= glh->buflen) { + GlLineNode *last; /* The last line in the buffer */ + GlLineNode *ln; /* A member of the list of line locations */ + int shift; /* The shift needed to move the contents of the */ +@@ -1897,15 +1897,15 @@ static GlLineNode *_glh_find_id(GlHistor + /* + * Search forwards from 'node'? + */ +- if(node->id < id) { +- while(node && node->id != id) ++ if((unsigned long)(node->id) < id) { ++ while(node && (unsigned long)(node->id) != id) + node = node->next; + glh->id_node = node ? node : glh->list.tail; + /* + * Search backwards from 'node'? + */ + } else { +- while(node && node->id != id) ++ while(node && (unsigned long)(node->id) != id) + node = node->prev; + glh->id_node = node ? node : glh->list.head; + }; |