Commit 2a97ab86 authored by Christian Beier's avatar Christian Beier

Fix some compiler warnings that hinted some no too unimportant errors.

parent ab74d36d
......@@ -2,6 +2,7 @@ immediate:
----------
- Add sources for the java stuff.
- Implement encryption in libvncserver.
- Add a libvncclient-config script.
make SDLvncviewer more versatile
- test for missing keys (especially "[]{}" with ./examples/mac),
......
......@@ -387,8 +387,8 @@ ConnectToRFBServer(rfbClient* client,const char *hostname, int port)
return FALSE;
}
setbuf(rec->file,NULL);
fread(buffer,1,strlen(magic),rec->file);
if (strncmp(buffer,magic,strlen(magic))) {
if (fread(buffer,1,strlen(magic),rec->file) != strlen(magic) || strncmp(buffer,magic,strlen(magic))) {
rfbClientLog("File %s was not recorded by vncrec.\n",client->serverHost);
fclose(rec->file);
return FALSE;
......
......@@ -111,7 +111,7 @@ ReadFromRFBServer(rfbClient* client, char *out, unsigned int n)
rec->tv=tv;
}
return (fread(out,1,n,rec->file)<0?FALSE:TRUE);
return (fread(out,1,n,rec->file) != n ? FALSE : TRUE);
}
if (n <= client->buffered) {
......
......@@ -152,7 +152,10 @@ int main(int argc,char **argv)
#ifdef USE_OLD_VCS
fread(buffer,width,height,tty_file);
#else
fread(buffer,width*height*2+4,1,tty_file);
if(fread(buffer,width*height*2+4,1,tty_file) != 1) {
rfbErr("Error reading framebuffer\n");
exit(1);
}
vcHideCursor(console);
#endif
fclose(tty_file);
......
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