On Mon, Jul 08, 2013 at 04:51:26PM +0100, Gianfranco Costamagna wrote:
> - fscanf(f, "%d", &num_bits);
> + int fs = fscanf(f, "%d", &num_bits);
> + if (EOF == fs) return ERR_NULL;
> key->bits = num_bits;
> len = size - sizeof(key->bits);
> for (i=0; i<len; i++) {
> - fscanf(f, "%2x", &n);
> + fs = fscanf(f, "%2x", &n);
> key->data[i] = n;
> + if (EOF == fs) return ERR_NULL;
Shouldn't these check that fscanf's result is 1
(e.g. change these to 'if (1 != fs)'?)
> - fscanf(f, "%d %d %d %d\n", &xpos, &ypos, &width, &height);
> + if (! fscanf(f, "%d %d %d %d\n", &xpos, &ypos, &width, &height)) {
> + fprintf(stderr,"Coud not parse parameters for xpos, ypos, width,
> height from glx_info file.\n");
> + }
And here shouldn't the check be != 4?
- Alyssa
_______________________________________________
boinc_dev mailing list
[email protected]
http://lists.ssl.berkeley.edu/mailman/listinfo/boinc_dev
To unsubscribe, visit the above URL and
(near bottom of page) enter your email address.