changeset 630:b9d4baa4f6fa

Warnings: Solved warnings related to possible problems with string length in combination with sprintf usage
author Ideenmodellierer
date Tue, 23 Feb 2021 21:54:56 +0100
parents 55a9aa740f13
children 49a662df8210
files Discovery/Src/tInfoLog.c Discovery/Src/tMenuCustom.c Discovery/Src/tMenuEditCustom.c
diffstat 3 files changed, 4 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/Discovery/Src/tInfoLog.c	Tue Feb 23 21:53:24 2021 +0100
+++ b/Discovery/Src/tInfoLog.c	Tue Feb 23 21:54:56 2021 +0100
@@ -302,7 +302,7 @@
 
     if((*text == 0) && (infolog.maxpages > 1))
     {
-        snprintf(text,8, "\002" "%u/%u", infolog.page, infolog.maxpages);
+        snprintf(text,10, "\002" "%u/%u", infolog.page, infolog.maxpages);
         gfx_write_topline_simple(&INFOLOGscreen, text, CLUT_InfoPageLogbook);
         *text = 0;
     }
--- a/Discovery/Src/tMenuCustom.c	Tue Feb 23 21:53:24 2021 +0100
+++ b/Discovery/Src/tMenuCustom.c	Tue Feb 23 21:54:56 2021 +0100
@@ -84,7 +84,7 @@
 			   break;
 
 		   default:
-			   snprintf(&text[textPointer++],2,"%u",settingsGetPointer()->extraDisplay);
+			   snprintf(&text[textPointer++],4,"%u",settingsGetPointer()->extraDisplay);
        break;
        }
     }
--- a/Discovery/Src/tMenuEditCustom.c	Tue Feb 23 21:53:24 2021 +0100
+++ b/Discovery/Src/tMenuEditCustom.c	Tue Feb 23 21:54:56 2021 +0100
@@ -170,7 +170,7 @@
         text[4] = '-';
         break;
     default:
-        snprintf(&text[4],2,"%u",settingsGetPointer()->tX_userselectedLeftLowerCornerPrimary);
+    	 text[4] = 'X';
     break;
     }
     text[5] = 0;
@@ -294,8 +294,7 @@
    				text[textIndex++] = TXT2BYTE_MoCtrlScroll;
    						break;
    			default:
-   					snprintf(&text[4],2,"%u",settingsGetPointer()->MotionDetection);
-    				textIndex++;
+   					textIndex += snprintf(&text[4],4,"%u",settingsGetPointer()->MotionDetection);
     			break;
         }
     	text[textIndex] = 0;