From b3122f97ee99b42e564a72558a5b4995e33b4002 Mon Sep 17 00:00:00 2001 From: riccardom Date: Fri, 25 Mar 2011 17:01:24 +0000 Subject: [PATCH] gtk-glade: Fix a couple of off-by-one reported by cppcheck --- desmume/src/gtk-glade/dTools/callbacks_1_ioregs.cpp | 2 +- desmume/src/gtk-glade/dTools/callbacks_4_tileview.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/desmume/src/gtk-glade/dTools/callbacks_1_ioregs.cpp b/desmume/src/gtk-glade/dTools/callbacks_1_ioregs.cpp index 96915839d..6088ede6a 100755 --- a/desmume/src/gtk-glade/dTools/callbacks_1_ioregs.cpp +++ b/desmume/src/gtk-glade/dTools/callbacks_1_ioregs.cpp @@ -66,7 +66,7 @@ static void wtools_1_update () { static u32 mem[NBR_IO_REGS]; static void update_regs_fast(){ - char text[10]; + char text[11]; int i; u32 w, m; for( i = 0; i < NBR_IO_REGS; i++ ) { diff --git a/desmume/src/gtk-glade/dTools/callbacks_4_tileview.cpp b/desmume/src/gtk-glade/dTools/callbacks_4_tileview.cpp index dda41d575..a8dc4ca24 100755 --- a/desmume/src/gtk-glade/dTools/callbacks_4_tileview.cpp +++ b/desmume/src/gtk-glade/dTools/callbacks_4_tileview.cpp @@ -174,7 +174,7 @@ static void refresh() { if (pal) { pal += palnum*16; for (tile_n=0; tile_n<1024; tile_n++) { - for (index=0; index<64; index++) { + for (index=0; index<64-1; index++) { if (index & 1) continue; palette_16[index] =pal[*index16 & 15]; palette_16[index+1]=pal[*index16 >> 4];