[padb] r320 committed - Replace %p with %lx in sscanf and 0x%lx in printf calls as ...

padb at googlecode.com padb at googlecode.com
Thu Nov 5 22:04:54 GMT 2009


Revision: 320
Author: apittman
Date: Thu Nov  5 14:04:01 2009
Log: Replace %p with %lx in sscanf and 0x%lx in printf calls as
%p doesn't work on solaris.

http://code.google.com/p/padb/source/detail?r=320

Modified:
  /trunk/src/minfo.c

=======================================
--- /trunk/src/minfo.c	Tue Nov  3 04:15:34 2009
+++ /trunk/src/minfo.c	Thu Nov  5 14:04:01 2009
@@ -141,9 +141,9 @@
      if ( i != 0 )
  	return NULL;

-    i = sscanf(ans, "%p",&addr);
+    i = sscanf(ans, "%lx",(long *)&addr);
      if ( i != 1 ) {
-	printf("Failed sscanf %d %p\n",i,addr);
+	printf("Failed sscanf %d 0x%lx\n",i,(long)addr);
  	return NULL;
      }

@@ -301,7 +301,7 @@
      if ( size == 0 )
  	return mqs_ok;

-    sprintf(req,"data %p %d",(void *)addr,size);
+    sprintf(req,"data 0x%lx %d",(long)addr,size);

      i = ask(req,ans);
      if ( i != 0 )
@@ -360,7 +360,7 @@
      char *ans = malloc(size+16);
      int i;

-    sprintf(req,"string %d %p",size,(void *)remote);
+    sprintf(req,"string %d 0x%lx",size,(long)remote);
      i = ask(req,ans);
      if ( i != 0 ) {
  	free(ans);
@@ -469,7 +469,7 @@
      else
  	printf("msg%d: Tag desired %d\n",msgid, (int)op->desired_tag);
      printf("msg%d: system_buffer %d\n",msgid,op->system_buffer);
-    printf("msg%d: Buffer %p\n",msgid,(void *)op->buffer);
+    printf("msg%d: Buffer 0x%lx\n",msgid,(long)op->buffer);

      i = 0;
      do {




More information about the padb-devel mailing list