[SDL_Tizen] Fix svace issue 98/187698/2 accepted/tizen/unified/20180828.182314 submit/tizen/20180828.045128
authorhuiyu.eun <huiyu.eun@samsung.com>
Tue, 28 Aug 2018 02:37:44 +0000 (11:37 +0900)
committerhuiyu.eun <huiyu.eun@samsung.com>
Tue, 28 Aug 2018 04:29:44 +0000 (13:29 +0900)
Change-Id: Ie3b08ed6d157641014f30a370fcb924f59758c9f
Signed-off-by: huiyu.eun <huiyu.eun@samsung.com>
extension/SDL2_ttf-2.0.14/showfont.c
src/power/linux/SDL_syspower.c

index c7a4f8d..e3e1b57 100755 (executable)
@@ -21,8 +21,8 @@
 
 /* A simple program to test the text rendering feature of the TTF library */
 
-/* quiet windows compiler warnings */\r
-#define _CRT_SECURE_NO_WARNINGS\r
+/* quiet windows compiler warnings */
+#define _CRT_SECURE_NO_WARNINGS
 
 #include <stdlib.h>
 #include <stdio.h>
@@ -218,7 +218,7 @@ int main(int argc, char *argv[])
 
             if( glyph ) {
                 char outname[64];
-                sprintf( outname, "glyph-%d.bmp", i );
+                snprintf(outname, 12, "glyph-%d.bmp", i );
                 SDL_SaveBMP( glyph, outname );
             }
 
@@ -233,7 +233,7 @@ int main(int argc, char *argv[])
     }
 
     /* Show which font file we're looking at */
-    sprintf(string, "Font file: %s", argv[0]);  /* possible overflow */
+    snprintf(string, 11 + strlen(argv[0]), "Font file: %s", argv[0]); /* possible overflow */
     if ( rendersolid ) {
         text = TTF_RenderText_Solid(font, string, *forecol);
     } else {
index 105d5fe..38b7578 100755 (executable)
@@ -612,6 +612,9 @@ SDL_GetPowerInfo_Linux_org_freedesktop_upower(SDL_PowerState *state, int *second
     SDL_DBusContext *dbus = SDL_DBus_GetContext();
     char **paths = NULL;
     int i, numpaths = 0;
+    if(!dbus) {
+        return retval;
+    }
 
     if (!SDL_DBus_CallMethodOnConnection(dbus->system_conn, UPOWER_DBUS_NODE, UPOWER_DBUS_PATH, UPOWER_DBUS_INTERFACE, "EnumerateDevices",
             DBUS_TYPE_INVALID,