diff options
author | Jeremy Allison <jra@samba.org> | 2002-01-08 01:22:23 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2002-01-08 01:22:23 +0000 |
commit | b19ec04f5228b76bc7953e5f8fc6d820ee610dfe (patch) | |
tree | 439d9a4f1ad95c77f8d8d4928cb57ec696a828c5 | |
parent | c1efcac59c001f70dcb4468d927cadcd49fdcf7a (diff) | |
download | samba-b19ec04f5228b76bc7953e5f8fc6d820ee610dfe.tar.gz samba-b19ec04f5228b76bc7953e5f8fc6d820ee610dfe.tar.bz2 samba-b19ec04f5228b76bc7953e5f8fc6d820ee610dfe.zip |
Caught one problem where a BOOL fn was returning 3 different values :-).
Roll on defined types :-).
Jeremy.
(This used to be commit ccf07e2184a93345a51455dd3e9201dee7be70e7)
-rw-r--r-- | source3/printing/nt_printing.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index 3436d2c1c4..5070cf1ac4 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -569,13 +569,14 @@ BOOL get_short_archi(char *short_archi, char *long_archi) } /**************************************************************************** -Version information in Microsoft files is held in a VS_VERSION_INFO structure. -There are two case to be covered here: PE (Portable Executable) and NE (New -Executable) files. Both files support the same INFO structure, but PE files -store the signature in unicode, and NE files store it as !unicode. + Version information in Microsoft files is held in a VS_VERSION_INFO structure. + There are two case to be covered here: PE (Portable Executable) and NE (New + Executable) files. Both files support the same INFO structure, but PE files + store the signature in unicode, and NE files store it as !unicode. + returns -1 on error, 1 on version info found, and 0 on no version info found. ****************************************************************************/ -static BOOL get_file_version(files_struct *fsp, char *fname,uint32 *major, - uint32 *minor) + +static int get_file_version(files_struct *fsp, char *fname,uint32 *major, uint32 *minor) { int i; char *buf; @@ -689,7 +690,7 @@ static BOOL get_file_version(files_struct *fsp, char *fname,uint32 *major, (*major>>16)&0xffff, *major&0xffff, (*minor>>16)&0xffff, *minor&0xffff)); SAFE_FREE(buf); - return True; + return 1; } } } @@ -699,7 +700,7 @@ static BOOL get_file_version(files_struct *fsp, char *fname,uint32 *major, /* Version info not found, fall back to origin date/time */ DEBUG(10,("get_file_version: PE file [%s] has no version info\n", fname)); SAFE_FREE(buf); - return False; + return 0; } else if (SVAL(buf,NE_HEADER_SIGNATURE_OFFSET) == NE_HEADER_SIGNATURE) { if (CVAL(buf,NE_HEADER_TARGET_OS_OFFSET) != NE_HEADER_TARGOS_WIN ) { @@ -766,7 +767,7 @@ static BOOL get_file_version(files_struct *fsp, char *fname,uint32 *major, (*major>>16)&0xffff, *major&0xffff, (*minor>>16)&0xffff, *minor&0xffff)); SAFE_FREE(buf); - return True; + return 1; } } } @@ -774,7 +775,7 @@ static BOOL get_file_version(files_struct *fsp, char *fname,uint32 *major, /* Version info not found, fall back to origin date/time */ DEBUG(0,("get_file_version: NE file [%s] Version info not found\n", fname)); SAFE_FREE(buf); - return False; + return 0; } else /* Assume this isn't an error... the file just looks sort of like a PE/NE file */ @@ -783,7 +784,7 @@ static BOOL get_file_version(files_struct *fsp, char *fname,uint32 *major, no_version_info: SAFE_FREE(buf); - return False; + return 0; error_exit: SAFE_FREE(buf); |