7022280: Parfait reports Format string argument mismatch in /jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c
authorbae
Wed, 09 Mar 2011 13:08:03 +0300
changeset 8745 6b9548badbaf
parent 8744 5f8a7e06e9a7
child 8746 3eef91f87691
7022280: Parfait reports Format string argument mismatch in /jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c Reviewed-by: jgodinez, prr
jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c
--- a/jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c	Tue Mar 08 11:47:38 2011 -0800
+++ b/jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c	Wed Mar 09 13:08:03 2011 +0300
@@ -240,7 +240,7 @@
 
     AwtGraphicsConfigDataPtr defaultConfig;
     int xinawareScreen = 0;
-    VisualID forcedVisualID, defaultVisualID;
+    VisualID forcedVisualID = 0, defaultVisualID;
     char *forcedVisualStr;
     XVisualInfo vinfo;
     long mask;
@@ -254,7 +254,7 @@
 
     if ((forcedVisualStr = getenv("FORCEDEFVIS"))) {
         mask = VisualIDMask | VisualScreenMask;
-        if (sscanf(forcedVisualStr, "%x", &forcedVisualID) > 0 &&
+        if (sscanf(forcedVisualStr, "%lx", &forcedVisualID) > 0 &&
             forcedVisualID > 0)
         {
             vinfo.visualid = forcedVisualID;