Print large unsigned values correctly (not as negative numbers) for
authorFrank Mori Hess <fmhess@speakeasy.net>
Mon, 8 Jan 2007 20:56:24 +0000 (20:56 +0000)
committerFrank Mori Hess <fmhess@speakeasy.net>
Mon, 8 Jan 2007 20:56:24 +0000 (20:56 +0000)
subdevice with 32 bit values.

demo/inp.c

index 1719ed3e9ece5d0931c2724f6e91c19e6e2eaa29..33f9bf9094576f9d2a4e93f0904291b5862ebb8e 100644 (file)
@@ -77,11 +77,11 @@ int main(int argc, char *argv[])
                                        range_info->unit);
                        }
                        if(options.verbose) {
-                               printf(" (%d raw units)", data);
+                               printf(" (%lu raw units)", (unsigned long)data);
                        }
                }
        } else {
-               printf("%d",data);
+               printf("%lu", (unsigned long)data);
        }
        printf("\n");