Web pgadmin.org
 Home 
 ·  ·  ·  ·  ·  ·  · 
CVS Commit by andreas: change unsigned conversion for oids

CVS Commit by andreas: change unsigned conversion for oids



Log Message:
-----------
change unsigned conversion for oids

Modified Files:
--------------
    pgadmin3/src/utils:
        misc.cpp (r1.61 -> r1.62)
    pgadmin3/src/db:
        pgSet.cpp (r1.47 -> r1.48)

Index: misc.cpp
===================================================================
RCS file: /projects/pgadmin3/src/utils/misc.cpp,v
retrieving revision 1.61
retrieving revision 1.62
diff -Lsrc/utils/misc.cpp -Lsrc/utils/misc.cpp -u -w -r1.61 -r1.62
--- src/utils/misc.cpp
+++ src/utils/misc.cpp
@@ -107,7 +107,7 @@
 wxString NumToStr(OID value)
 {
     wxString result;
-    result.Printf(wxT("%u"), (long)value);
+    result.Printf(wxT("%lu"), (long)value);
     return result;
 }
 
@@ -120,9 +120,10 @@
 
 OID StrToOid(const wxString& value)
 {
-    return (OID)atol(value.ToAscii());
+    return (OID)strtoul(value.ToAscii(), 0, 10);
 }
 
+
 wxString NumToStr(double value)
 {
     wxString result;
Index: pgSet.cpp
===================================================================
RCS file: /projects/pgadmin3/src/db/pgSet.cpp,v
retrieving revision 1.47
retrieving revision 1.48
diff -Lsrc/db/pgSet.cpp -Lsrc/db/pgSet.cpp -u -w -r1.47 -r1.48
--- src/db/pgSet.cpp
+++ src/db/pgSet.cpp
@@ -255,7 +255,11 @@
 
 OID pgSet::GetOid(const int col) const
 {
-    return (OID)GetLong(col);
+    char *c=PQgetvalue(res, pos-1, col);
+    if (c)
+        return (OID)strtoul(c, 0, 10);
+    else
+        return 0;
 }
 
 


Home | Main Index | Thread Index

top