summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSven Herzberg <herzberg.sven@googlemail.com>2012-07-03 18:10:32 +0200
committerSven Herzberg <herzberg.sven@googlemail.com>2012-07-03 18:12:07 +0200
commitfd6b3c6de21724f8dff524d602ef88c8b3128da7 (patch)
tree4b1739525c2fc1243511e635191f24f4a966dfb7 /src
parentafc4d6e25ed75379fd70eb4d984582d9dfc21056 (diff)
downloadnyancat-fd6b3c6de21724f8dff524d602ef88c8b3128da7.tar.gz
do not hardcode sizes
This patch will fix the following warning I received from gcc: > nyancat.c: In function ‘main’: > nyancat.c:497: warning: comparison is always true due to limited range of data type * src/nyancat.c: adjust the size of the array and update the references to its size
Diffstat (limited to 'src')
-rw-r--r--src/nyancat.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nyancat.c b/src/nyancat.c
index 234ff10..fbb3c6e 100644
--- a/src/nyancat.c
+++ b/src/nyancat.c
@@ -483,7 +483,7 @@ int main(int argc, char ** argv) {
/* Begin Extended Option Mode */
sb_mode = 1;
sb_len = 0;
- memset(sb, 0, 1024);
+ memset(sb, 0, sizeof(sb));
break;
case IAC:
/* IAC IAC? That's probably not right. */
@@ -494,7 +494,7 @@ int main(int argc, char ** argv) {
}
} else if (sb_mode) {
/* Extended Option Mode -> Accept character */
- if (sb_len < 1023) {
+ if (sb_len < sizeof(sb) - 1) {
/* Append this character to the SB string,
* but only if it doesn't put us over
* our limit; honestly, we shouldn't hit
.07b18ec-1&id=199e3529a4e095c4a9974199ef5e9042e77e1e78&follow=1'>New Upstream Snapshot (commit 1246b27)Jonathan McCrohan1-0/+6 2014-05-13Imported Upstream version 0+git20140512.1246b27upstream/0+git20140512.1246b27Jonathan McCrohan391-301/+3983 2014-04-05Release 0+git20140326.cfc2975-1debian/0+git20140326.cfc2975-1Jonathan McCrohan1-2/+2 2014-04-05d/control: update Homepage (upstream has moved from Gitweb to cgit)Jonathan McCrohan2-1/+2 2014-04-05New Upstream Snapshot (commit cfc2975)Jonathan McCrohan1-0/+6 2014-04-05Imported Upstream version 0+git20140326.cfc2975upstream/0+git20140326.cfc2975Jonathan McCrohan118-656/+877 2014-01-16Release 0+git20140107.1850cf8-1debian/0+git20140107.1850cf8-1Jonathan McCrohan1-2/+2 2014-01-16Update Standards Version to 3.9.5Jonathan McCrohan2-1/+9