summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garcia Campos <carlosgc@gnome.org>2010-03-28 13:18:38 +0200
committerCarlos Garcia Campos <carlosgc@gnome.org>2010-03-28 13:18:38 +0200
commit35aa9dfac2631de24a40d95d1469acb52f379249 (patch)
tree9758da510e39bac356e88cc235ecc329e0e98259
parent75a268029e803a34ce93b7094809ee15be0a9c08 (diff)
Use the correct format string for DisplayHandle arg depending on the platform
-rw-r--r--libspectre/spectre-device.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libspectre/spectre-device.c b/libspectre/spectre-device.c
index d181fe7..a4deac2 100644
--- a/libspectre/spectre-device.c
+++ b/libspectre/spectre-device.c
@@ -179,6 +179,7 @@ spectre_device_render (SpectreDevice *device,
int n_args = 12;
int arg = 0;
int success;
+ char *fmt;
char *text_alpha, *graph_alpha;
char *size = NULL;
char *resolution, *set;
@@ -239,8 +240,10 @@ spectre_device_render (SpectreDevice *device,
DISPLAY_LITTLEENDIAN |
#endif
DISPLAY_TOPFIRST);
- args[arg++] = dsp_handle = _spectre_strdup_printf ("-sDisplayHandle=16#%llx",
- (uintptr_t)device);
+ fmt = _spectre_strdup_printf ("-sDisplayHandle=16#%s",
+ sizeof (device) == 4 ? "%lx" : "%llx");
+ args[arg++] = dsp_handle = _spectre_strdup_printf (fmt, device);
+ free (fmt);
if (rc->use_platform_fonts == FALSE)
args[arg++] = "-dNOPLATFONTS";