Include protection for <unistd.h>, <sys/types.h> and <sys/stat.h>.
This commit is contained in:
parent
e75542ae24
commit
c63d98038a
|
@ -30,8 +30,17 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
#include <fcntl.h>
|
||||
#ifdef HAVE_IO_H
|
||||
# include <io.h>
|
||||
#endif
|
||||
|
||||
#ifndef O_BINARY
|
||||
# define O_BINARY 0
|
||||
#endif
|
||||
|
||||
#include "fnt2bdf.h"
|
||||
#include "module.h"
|
||||
|
@ -146,6 +155,13 @@ int parse_fnt_data(unsigned char* file_buffer, int length)
|
|||
t = return_data_value(dfShort, &cpe_font_struct.hdr.dfVersion);
|
||||
if( t != 0x300 && t != 0x200) return ERROR_VERSION;
|
||||
|
||||
t = return_data_value(dfShort, &cpe_font_struct.hdr.fi.dfType);
|
||||
if (t & 1)
|
||||
{
|
||||
fprintf(stderr, "Vector fonts not supported\n");
|
||||
return ERROR_DATA;
|
||||
}
|
||||
|
||||
t = return_data_value(dfLong, &cpe_font_struct.hdr.dfSize);
|
||||
if( t > length ) return ERROR_SIZE;
|
||||
else
|
||||
|
@ -176,7 +192,7 @@ int parse_fnt_data(unsigned char* file_buffer, int length)
|
|||
if( return_data_value(dfShort, &cpe_font_struct.hdr.dfVersion) == 0x200) {
|
||||
cpe_font_struct.dfCharTable[ic].charOffset =
|
||||
return_data_value(dfShort, &file_buffer[l_ptr]);
|
||||
l_ptr += 2; /* bump by sizeof(long) */
|
||||
l_ptr += 2; /* bump by sizeof(short) */
|
||||
}
|
||||
else { /* Windows Version 3.0 type font */
|
||||
cpe_font_struct.dfCharTable[ic].charOffset =
|
||||
|
@ -540,7 +556,7 @@ int main(int argc, char **argv)
|
|||
|
||||
parse_options( argc, argv);
|
||||
|
||||
if( (fd = open( g_lpstrInputFile, O_RDONLY)) )
|
||||
if( (fd = open( g_lpstrInputFile, O_RDONLY | O_BINARY)) )
|
||||
{
|
||||
int i;
|
||||
struct stat file_stat;
|
||||
|
@ -574,7 +590,7 @@ int main(int argc, char **argv)
|
|||
unsigned short size_shift = return_data_value(dfShort, lpdata);
|
||||
unsigned char* lpfont = NULL;
|
||||
unsigned offset;
|
||||
unsigned length;
|
||||
int length;
|
||||
|
||||
for( j = 0; j < count; j++, pFontStorage++ )
|
||||
{
|
||||
|
|
|
@ -25,7 +25,9 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
/* Max first-level includes per file */
|
||||
#define MAX_INCLUDES 200
|
||||
|
|
|
@ -22,7 +22,9 @@
|
|||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
|
|
|
@ -33,12 +33,16 @@ uuid {hexd}{8}-{hexd}{4}-{hexd}{4}-{hexd}{4}-{hexd}{12}
|
|||
|
||||
%{
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <assert.h>
|
||||
#include <unistd.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include "widl.h"
|
||||
#include "utils.h"
|
||||
|
|
|
@ -22,7 +22,9 @@
|
|||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
|
|
|
@ -23,7 +23,9 @@
|
|||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
|
|
|
@ -26,7 +26,9 @@
|
|||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include "build.h"
|
||||
|
||||
|
|
|
@ -25,9 +25,13 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
#include <fcntl.h>
|
||||
#include <sys/stat.h>
|
||||
#ifdef HAVE_SYS_STAT_H
|
||||
# include <sys/stat.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_MMAN_H
|
||||
#include <sys/mman.h>
|
||||
#endif
|
||||
|
|
|
@ -25,9 +25,13 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
#include <fcntl.h>
|
||||
#include <sys/stat.h>
|
||||
#ifdef HAVE_SYS_STAT_H
|
||||
# include <sys/stat.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_MMAN_H
|
||||
#include <sys/mman.h>
|
||||
#endif
|
||||
|
|
|
@ -25,10 +25,16 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
#include <time.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_STAT_H
|
||||
# include <sys/stat.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_MMAN_H
|
||||
#include <sys/mman.h>
|
||||
#endif
|
||||
|
@ -480,4 +486,3 @@ void dump_codeview(unsigned long base, unsigned long len)
|
|||
{
|
||||
dump_codeview_headers(base, len);
|
||||
}
|
||||
|
||||
|
|
|
@ -23,10 +23,16 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
#include <time.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_STAT_H
|
||||
# include <sys/stat.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_MMAN_H
|
||||
#include <sys/mman.h>
|
||||
#endif
|
||||
|
|
|
@ -24,7 +24,9 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include "wpp_private.h"
|
||||
|
||||
|
|
|
@ -52,7 +52,9 @@
|
|||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
|
|
Loading…
Reference in New Issue