Need help with glGetInfoLogARB

As you could read from the topic i have some problem with this code. What I´m trying to do is read the debug information that the driver logs about the shades it compiles. Now all I get in the consol is lots of “?” and “.”.
This is the code I´m using, the shader is the handel for the diffrent shaders.

      private static void printDebug(GL gl, int shader) {            
            int compileStatus[] = new int[1];
            int infoLogLength[] = new int[1];

            gl.glGetObjectParameterivARB(shader, GL.GL_OBJECT_COMPILE_STATUS_ARB, compileStatus);
            gl.glGetObjectParameterivARB(shader, GL.GL_OBJECT_INFO_LOG_LENGTH_ARB, infoLogLength);
            
            if(compileStatus[0] == 0) {      
                  ByteBuffer text = ByteBuffer.allocateDirect(1000).order(ByteOrder.nativeOrder());
                  IntBuffer size = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()).asIntBuffer();
                  //byte text[] = new byte[1000];
                  //int size[] = new int[1];
                  
                  gl.glGetInfoLogARB(shader, 1000, size, text);

                  for(int i = 0; i < infoLogLength[0]; i++) {
                        //System.out.print(text[i]);
                        System.out.print( text.getChar() );
                  }
                  System.out.println("");
            }
      }

My current system is P4 3.0ghz Radeon PRO 128mb WinXp with the latest drivers from ATI.
GL_VENDOR : ATI Technologies Inc.
GL_RENDERER: RADEON 9800 Pro x86/SSE2
GL_VERSION : 1.5.4650 WinXP Release

If you use System.out.print((char) text.get()) instead, that should cause valid output to be printed. However the code you use could be slightly simpler – if you use glGet of GL_OBJECT_INFO_LOG_LENGTH_ARB then you should be able to pass null instead of the “size” argument to glGetInfoLogARB.

Thanks that worked perfect!