summaryrefslogtreecommitdiffstats
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
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
-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
eillmichael5-5/+444 2008-12-24w1retap plugin by Jonathan Hudsonmichael7-0/+298 2008-12-24Enables/controls the backlight on the Pertelian LCD device by Jonathan Hudsonmichael1-10/+13 2008-12-23hddtemp plugin from Scott Bronsonmichael7-0/+343 2008-12-23keypad bug fixedmichael1-1/+1 2008-12-23patch from a.nielsen: inverted parport signals, support GPI on HD44780michael2-24/+89 2008-12-23indent runmichael1-4/+4 2008-11-25fix lcd4linux driver for multible onboard controllersmichux1-4/+4 2008-11-23fix automake - check for libftdimichux4-9/+173 2008-11-22update button_exec plugin - fix segfaultmichux1-3/+2 2008-11-22update fifo plugin - untestedmichux1-1/+1 2008-10-07Replace write to external variable usb_debug by calling usb_set_debug().bwalle7-16/+7 2008-10-06adding GPI to picoLCD for reading button events by Igor Mammedov <niallain@g...michael1-1/+22 2008-10-06properties fixedmichael11-3290/+2675 2008-10-05Rebuild auto-generated autoconf stuff due to last change in drivers.m4.bwalle3-2657/+3297 2008-10-05Add 'ULA200' driver when --with-drivers=all is specifiedbwalle1-0/+1 2008-09-14strftime_tz patch from Bernhard Wallemichael1-0/+11 2008-09-08strftime_tz() plugin by Bernhard Wallemichael1-0/+25 2008-09-03ULA200 driver by Bernhard Wallemichael7-2/+825 2008-09-03indentmichael1-4/+4 2008-08-31Increased the maximum bps to 230400, if defined in <termios.h>.sonic741-2/+7 2008-08-27git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@889 3ae390bd-cb1e-0410-...sonic741-18/+11 2008-08-27D4D updates by Svenmichael1-38/+60 2008-08-03driver for 4D Systems serial displays by Sven Killigmichael9-45/+846 2008-08-03signed/unsigned mismatchmichael1-3/+3 2008-07-26added command functionsmichux1-2/+130 2008-07-15added IRLCD driver by Jean-Philippe Civademichael10-5/+467 2008-07-15'autoreconf -f -i' run & config.rpath addedmichael8-370/+1617