From fd6b3c6de21724f8dff524d602ef88c8b3128da7 Mon Sep 17 00:00:00 2001 From: Sven Herzberg Date: Tue, 3 Jul 2012 18:10:32 +0200 Subject: do not hardcode sizes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/nyancat.c | 4 ++-- 1 file 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 -- cgit v1.2.3 llow=1'>logtreecommitdiffstats
path: root/plugin_mysql.c (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2008-04-12clean upmichux1-171/+188
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@871 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2008-04-10Add the year 2008 to the copyrightmichux1-1/+1
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@870 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2008-04-10Add basic FIFO pluginmichux4-0/+197
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@869 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2008-04-04fixed autoconfmichux2-0/+3
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@868 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2008-04-04update autoconfmichux5-2392/+438
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@867 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2008-04-04Add asterisk plugin, thanks to mcarey@yostengineering.commichux3-1/+197
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@866 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2008-04-03fix typo, close #114michux1-1/+1
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@865 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2008-04-03update charset for Crystalfontz Model 632 and 634michux2-3/+87
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@864 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2008-03-05improve error messagesmichux1-7/+13
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@863 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2008-03-03reformat plugin_mpd - use c style commentsmichux1-8/+8
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@862 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2008-03-03correct code format (indent)michux1-2/+2
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@861 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2008-03-03correct code format (indent)michux5-184/+185
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@860 3ae390bd-cb1e-0410-b409-cd5a39f66f1f