return 1;
}
tmppath=find_file(stradd(charset,CHARSET_EXT),charset_path);
- if (tmppath&& *tmppath) {
- *filename=strdup(charset);
- free(tmppath);
- return 1;
+ /* Some compilers evalate both arguments of && before
+ applying, so let's not use && as in the shell */
+ if (tmppath) {
+ if (*tmppath) {
+ *filename=strdup(charset);
+ free(tmppath);
+ return 1;
+ }
}
return 0;
}
#define RTFNAMEMAXLEN 32
#define RTFARGSMAXLEN 64
+#define MAX_DIGITS_IN_NUMBER 10
/**
* Structure describing rtf command
int c,count=0;
char buf[RTFARGSMAXLEN];
- while(isdigit(c=fgetc(f)) || c=='-') {
+ while((isdigit(c=fgetc(f)) || c=='-')) {
if(feof(f))
return -1;
+ if (count > MAX_DIGITS_IN_NUMBER)
+ break;
buf[count++]=(char)c;
}
ungetc(c,f);