summaryrefslogtreecommitdiffstats
path: root/source3/services
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2010-09-20 00:46:59 +0200
committerMichael Adam <obnox@samba.org>2010-09-21 06:53:30 +0200
commitf53c17b4ff27c39fbeccce4d369f4bb8f1b13ce7 (patch)
treebb190f0519faa7b6f3ca4a463319ee2c19ce03ff /source3/services
parenta67a553f40833a182b89a058d59015bcf19640f0 (diff)
downloadsamba-f53c17b4ff27c39fbeccce4d369f4bb8f1b13ce7.tar.gz
samba-f53c17b4ff27c39fbeccce4d369f4bb8f1b13ce7.tar.xz
samba-f53c17b4ff27c39fbeccce4d369f4bb8f1b13ce7.zip
s3:services_db: untanlge assignments from check in read_init_file().
Diffstat (limited to 'source3/services')
-rw-r--r--source3/services/services_db.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/source3/services/services_db.c b/source3/services/services_db.c
index f3c550a91f..c819862b55 100644
--- a/source3/services/services_db.c
+++ b/source3/services/services_db.c
@@ -203,8 +203,10 @@ static bool read_init_file( const char *servicename, struct rcinit_file_informat
XFILE *f = NULL;
char *p = NULL;
- if ( !(info = TALLOC_ZERO_P( NULL, struct rcinit_file_information ) ) )
+ info = TALLOC_ZERO_P( NULL, struct rcinit_file_information );
+ if (info == NULL) {
return False;
+ }
/* attempt the file open */
@@ -214,7 +216,8 @@ static bool read_init_file( const char *servicename, struct rcinit_file_informat
TALLOC_FREE(info);
return false;
}
- if (!(f = x_fopen( filepath, O_RDONLY, 0 ))) {
+ f = x_fopen( filepath, O_RDONLY, 0 );
+ if (f == NULL) {
DEBUG(0,("read_init_file: failed to open [%s]\n", filepath));
TALLOC_FREE(info);
return false;
@@ -229,14 +232,16 @@ static bool read_init_file( const char *servicename, struct rcinit_file_informat
/* Look for a line like '^#.*Description:' */
- if ( (p = strstr( str, "Description:" )) != NULL ) {
+ p = strstr( str, "Description:" );
+ if (p != NULL) {
char *desc;
p += strlen( "Description:" ) + 1;
if ( !p )
break;
- if ( (desc = cleanup_string(p)) != NULL )
+ desc = cleanup_string(p);
+ if (desc != NULL)
info->description = talloc_strdup( info, desc );
}
}