Commit 3c4522e6 authored by dscho's avatar dscho

do not crash when /tmp is not writable

parent b36ca237
...@@ -31,7 +31,11 @@ void SaveFramebufferAsPPM(rfbClient* client, int x, int y, int w, int h) { ...@@ -31,7 +31,11 @@ void SaveFramebufferAsPPM(rfbClient* client, int x, int y, int w, int h) {
return; 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); 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) for(j=0;j<client->height*row_stride;j+=row_stride)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment