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

pull/1/head
Christian Beier 13 years ago
parent ab74d36dcd
commit 2a97ab8679

@ -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);

Loading…
Cancel
Save