summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordscho <dscho>2005-03-01 21:04:50 +0000
committerdscho <dscho>2005-03-01 21:04:50 +0000
commit3c4522e67652d36162d007dce1dcd798562da5fb (patch)
tree26e95ef7ceefc9e173e13a06cfa3c1b94b14eaf1
parentb36ca2379084baac477dc89e5d6a045995141b68 (diff)
downloadlibtdevnc-3c4522e67652d36162d007dce1dcd798562da5fb.tar.gz
libtdevnc-3c4522e67652d36162d007dce1dcd798562da5fb.zip
do not crash when /tmp is not writable
-rw-r--r--client_examples/ppmtest.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/client_examples/ppmtest.c b/client_examples/ppmtest.c
index 01ee6a7..6b84ad3 100644
--- a/client_examples/ppmtest.c
+++ b/client_examples/ppmtest.c
@@ -31,7 +31,11 @@ void SaveFramebufferAsPPM(rfbClient* client, int x, int y, int w, int h) {
return;
}
- f=fopen("/tmp/framebuffer.ppm","wb");
+ f=fopen("framebuffer.ppm","wb");
+ if(!f) {
+ rfbClientErr("Could not open framebuffer.ppm\n");
+ return;
+ }
fprintf(f,"P6\n# %s\n%d %d\n255\n",client->desktopName,client->width,client->height);
for(j=0;j<client->height*row_stride;j+=row_stride)