From: didg Date: Sun, 12 Jan 2003 14:39:57 +0000 (+0000) Subject: stupid stuff, replace X-Git-Tag: netatalk-2-0-alpha1~277 X-Git-Url: https://arthur.barton.de/gitweb/?a=commitdiff_plain;h=d5fe0508bed28ef27f5d3c98315d84f96dd357c4;p=netatalk.git stupid stuff, replace if ((a = b) == c) with if (c == (a = b)) for '==' and '!=' operators. the form ((a = b) == c) is confusing for some, not smart enough, data-flow analyser. --- diff --git a/etc/afpd/afp_options.c b/etc/afpd/afp_options.c index eba6c660..2e75bcc0 100644 --- a/etc/afpd/afp_options.c +++ b/etc/afpd/afp_options.c @@ -1,5 +1,5 @@ /* - * $Id: afp_options.c,v 1.28 2002-12-07 02:39:57 rlewczuk Exp $ + * $Id: afp_options.c,v 1.29 2003-01-12 14:39:57 didg Exp $ * * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu) * Copyright (c) 1990,1993 Regents of The University of Michigan. @@ -428,17 +428,17 @@ int afp_options_parse(int ac, char **av, struct afp_options *options) perror( "gethostname" ); return 0; } - if (( p = strchr(options->hostname, '.' )) != 0 ) { + if (NULL != ( p = strchr(options->hostname, '.' )) ) { *p = '\0'; } - if (( p = strrchr( av[ 0 ], '/' )) == NULL ) { + if (NULL == ( p = strrchr( av[ 0 ], '/' )) ) { p = av[ 0 ]; } else { p++; } - while (( c = getopt( ac, av, OPTIONS )) != EOF ) { + while (EOF != ( c = getopt( ac, av, OPTIONS )) ) { switch ( c ) { case 'd' : options->flags |= OPTION_DEBUG; diff --git a/etc/afpd/appl.c b/etc/afpd/appl.c index f6bd37ac..81734691 100644 --- a/etc/afpd/appl.c +++ b/etc/afpd/appl.c @@ -1,5 +1,5 @@ /* - * $Id: appl.c,v 1.9 2003-01-08 15:01:33 didg Exp $ + * $Id: appl.c,v 1.10 2003-01-12 14:39:58 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -181,7 +181,7 @@ int ibuflen, *rbuflen; memcpy( &vid, ibuf, sizeof( vid )); ibuf += sizeof( vid ); - if (( vol = getvolbyvid( vid )) == NULL ) { + if (NULL == ( vol = getvolbyvid( vid ))) { return( AFPERR_PARAM ); } @@ -267,7 +267,7 @@ int ibuflen, *rbuflen; memcpy( &vid, ibuf, sizeof( vid )); ibuf += sizeof( vid ); - if (( vol = getvolbyvid( vid )) == NULL ) { + if (NULL == ( vol = getvolbyvid( vid ))) { return( AFPERR_PARAM ); } @@ -335,7 +335,7 @@ int ibuflen, *rbuflen; memcpy( &vid, ibuf, sizeof( vid )); ibuf += sizeof( vid ); - if (( vol = getvolbyvid( vid )) == NULL ) { + if (NULL == ( vol = getvolbyvid( vid )) ) { *rbuflen = 0; return( AFPERR_PARAM ); } diff --git a/etc/afpd/desktop.c b/etc/afpd/desktop.c index e26993bb..b92318fc 100644 --- a/etc/afpd/desktop.c +++ b/etc/afpd/desktop.c @@ -1,5 +1,5 @@ /* - * $Id: desktop.c,v 1.20 2003-01-08 15:01:33 didg Exp $ + * $Id: desktop.c,v 1.21 2003-01-12 14:39:58 didg Exp $ * * See COPYRIGHT. * @@ -60,7 +60,7 @@ int ibuflen, *rbuflen; ibuf += 2; memcpy( &vid, ibuf, sizeof(vid)); - if (( vol = getvolbyvid( vid )) == NULL ) { + if (NULL == ( vol = getvolbyvid( vid )) ) { *rbuflen = 0; return( AFPERR_PARAM ); } @@ -768,17 +768,17 @@ int ibuflen, *rbuflen; memcpy( &vid, ibuf, sizeof( vid )); ibuf += sizeof( vid ); - if (( vol = getvolbyvid( vid )) == NULL ) { + if (NULL == ( vol = getvolbyvid( vid )) ) { return( AFPERR_PARAM ); } memcpy( &did, ibuf, sizeof( did )); ibuf += sizeof( did ); - if (( dir = dirlookup( vol, did )) == NULL ) { + if (NULL == ( dir = dirlookup( vol, did )) ) { return afp_errno; } - if (( path = cname( vol, dir, &ibuf )) == NULL ) { + if (NULL == ( path = cname( vol, dir, &ibuf )) ) { return afp_errno; } @@ -843,17 +843,17 @@ int ibuflen, *rbuflen; memcpy( &vid, ibuf, sizeof( vid )); ibuf += sizeof( vid ); - if (( vol = getvolbyvid( vid )) == NULL ) { + if (NULL == ( vol = getvolbyvid( vid )) ) { return( AFPERR_PARAM ); } memcpy( &did, ibuf, sizeof( did )); ibuf += sizeof( did ); - if (( dir = dirlookup( vol, did )) == NULL ) { + if (NULL == ( dir = dirlookup( vol, did )) ) { return afp_errno; } - if (( s_path = cname( vol, dir, &ibuf )) == NULL ) { + if (NULL == ( s_path = cname( vol, dir, &ibuf )) ) { return afp_errno; } @@ -909,17 +909,17 @@ int ibuflen, *rbuflen; memcpy( &vid, ibuf, sizeof( vid )); ibuf += sizeof( vid ); - if (( vol = getvolbyvid( vid )) == NULL ) { + if (NULL == ( vol = getvolbyvid( vid )) ) { return( AFPERR_PARAM ); } memcpy( &did, ibuf, sizeof( did )); ibuf += sizeof( did ); - if (( dir = dirlookup( vol, did )) == NULL ) { + if (NULL == ( dir = dirlookup( vol, did )) ) { return afp_errno; } - if (( s_path = cname( vol, dir, &ibuf )) == NULL ) { + if (NULL == ( s_path = cname( vol, dir, &ibuf ))) { return afp_errno; } diff --git a/etc/afpd/directory.c b/etc/afpd/directory.c index 32c73ba1..8464aad3 100644 --- a/etc/afpd/directory.c +++ b/etc/afpd/directory.c @@ -1,5 +1,5 @@ /* - * $Id: directory.c,v 1.55 2003-01-08 15:01:33 didg Exp $ + * $Id: directory.c,v 1.56 2003-01-12 14:39:58 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -147,7 +147,7 @@ u_int32_t did; return ret; id = did; - if ((upath = cnid_resolve(vol->v_db, &id, buffer, buflen)) == NULL) { + if (NULL == (upath = cnid_resolve(vol->v_db, &id, buffer, buflen)) ) { afp_errno = AFPERR_NOOBJ; return NULL; } @@ -1273,7 +1273,7 @@ int ibuflen, *rbuflen; memcpy( &vid, ibuf, sizeof( vid )); ibuf += sizeof( vid ); - if (( vol = getvolbyvid( vid )) == NULL ) { + if (NULL == ( vol = getvolbyvid( vid )) ) { return( AFPERR_PARAM ); } @@ -1645,7 +1645,7 @@ int ibuflen, *rbuflen; memcpy( &vid, ibuf, sizeof( vid )); ibuf += sizeof( vid ); - if (( vol = getvolbyvid( vid )) == NULL ) { + if (NULL == ( vol = getvolbyvid( vid )) ) { return( AFPERR_PARAM ); } @@ -1654,11 +1654,11 @@ int ibuflen, *rbuflen; memcpy( &did, ibuf, sizeof( did )); ibuf += sizeof( did ); - if (( dir = dirlookup( vol, did )) == NULL ) { + if (NULL == ( dir = dirlookup( vol, did )) ) { return( AFPERR_NOOBJ ); } - if (( s_path = cname( vol, dir, &ibuf )) == NULL ) { + if (NULL == ( s_path = cname( vol, dir, &ibuf )) ) { return afp_errno; } /* FIXME check done elswhere? cname was able to move curdir to it! */ @@ -2153,18 +2153,18 @@ int ibuflen, *rbuflen; memcpy(&vid, ibuf, sizeof(vid)); ibuf += sizeof( vid ); - if (( vol = getvolbyvid( vid )) == NULL ) { + if (NULL == ( vol = getvolbyvid( vid )) ) { return( AFPERR_PARAM ); } memcpy(&did, ibuf, sizeof(did)); ibuf += sizeof(did); - if (( parentdir = dirlookup( vol, did )) == NULL ) { + if (NULL == ( parentdir = dirlookup( vol, did )) ) { return afp_errno; } - if (( path = cname( vol, parentdir, &ibuf )) == NULL ) { + if (NULL == ( path = cname( vol, parentdir, &ibuf )) ) { return afp_errno; } diff --git a/etc/afpd/enumerate.c b/etc/afpd/enumerate.c index 3e6eb96e..cc3473fa 100644 --- a/etc/afpd/enumerate.c +++ b/etc/afpd/enumerate.c @@ -1,5 +1,5 @@ /* - * $Id: enumerate.c,v 1.29 2003-01-07 22:13:39 didg Exp $ + * $Id: enumerate.c,v 1.30 2003-01-12 14:39:59 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -244,7 +244,7 @@ int ext; memcpy( &vid, ibuf, sizeof( vid )); ibuf += sizeof( vid ); - if (( vol = getvolbyvid( vid )) == NULL ) { + if (NULL == ( vol = getvolbyvid( vid )) ) { *rbuflen = 0; return( AFPERR_PARAM ); } @@ -252,7 +252,7 @@ int ext; memcpy( &did, ibuf, sizeof( did )); ibuf += sizeof( did ); - if (( dir = dirlookup( vol, did )) == NULL ) { + if (NULL == ( dir = dirlookup( vol, did )) ) { *rbuflen = 0; return( AFPERR_NODIR ); } @@ -310,7 +310,7 @@ int ext; maxsz = min(maxsz, *rbuflen); - if (( o_path = cname( vol, dir, &ibuf )) == NULL) { + if (NULL == ( o_path = cname( vol, dir, &ibuf )) ) { *rbuflen = 0; return( AFPERR_NODIR ); } diff --git a/etc/afpd/file.c b/etc/afpd/file.c index 32073ad8..4529f370 100644 --- a/etc/afpd/file.c +++ b/etc/afpd/file.c @@ -1,5 +1,5 @@ /* - * $Id: file.c,v 1.71 2003-01-11 17:26:06 jmarcus Exp $ + * $Id: file.c,v 1.72 2003-01-12 14:39:59 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -535,7 +535,7 @@ int ibuflen, *rbuflen; memcpy(&vid, ibuf, sizeof( vid )); ibuf += sizeof( vid ); - if (( vol = getvolbyvid( vid )) == NULL ) { + if (NULL == ( vol = getvolbyvid( vid )) ) { return( AFPERR_PARAM ); } @@ -545,11 +545,11 @@ int ibuflen, *rbuflen; memcpy(&did, ibuf, sizeof( did)); ibuf += sizeof( did ); - if (( dir = dirlookup( vol, did )) == NULL ) { + if (NULL == ( dir = dirlookup( vol, did )) ) { return afp_errno; } - if (( s_path = cname( vol, dir, &ibuf )) == NULL ) { + if (NULL == ( s_path = cname( vol, dir, &ibuf )) ) { return afp_errno; } @@ -645,7 +645,7 @@ int ibuflen, *rbuflen; memcpy(&vid, ibuf, sizeof( vid )); ibuf += sizeof( vid ); - if (( vol = getvolbyvid( vid )) == NULL ) { + if (NULL == ( vol = getvolbyvid( vid )) ) { return( AFPERR_PARAM ); } @@ -1033,13 +1033,13 @@ int ibuflen, *rbuflen; memcpy(&svid, ibuf, sizeof( svid )); ibuf += sizeof( svid ); - if (( vol = getvolbyvid( svid )) == NULL ) { + if (NULL == ( vol = getvolbyvid( svid )) ) { return( AFPERR_PARAM ); } memcpy(&sdid, ibuf, sizeof( sdid )); ibuf += sizeof( sdid ); - if (( dir = dirlookup( vol, sdid )) == NULL ) { + if (NULL == ( dir = dirlookup( vol, sdid )) ) { return afp_errno; } @@ -1516,7 +1516,7 @@ int ibuflen, *rbuflen; memcpy(&vid, ibuf, sizeof(vid)); ibuf += sizeof(vid); - if (( vol = getvolbyvid( vid )) == NULL ) { + if (NULL == ( vol = getvolbyvid( vid )) ) { return( AFPERR_PARAM); } @@ -1786,7 +1786,7 @@ int ibuflen, *rbuflen; memcpy(&vid, ibuf, sizeof(vid)); ibuf += sizeof(vid); - if (( vol = getvolbyvid( vid )) == NULL ) { + if (NULL == ( vol = getvolbyvid( vid )) ) { return( AFPERR_PARAM); } diff --git a/etc/afpd/filedir.c b/etc/afpd/filedir.c index a34b6a6c..6ea49b2b 100644 --- a/etc/afpd/filedir.c +++ b/etc/afpd/filedir.c @@ -1,5 +1,5 @@ /* - * $Id: filedir.c,v 1.37 2003-01-08 15:01:34 didg Exp $ + * $Id: filedir.c,v 1.38 2003-01-12 14:40:01 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -159,14 +159,14 @@ int ibuflen, *rbuflen; memcpy( &vid, ibuf, sizeof( vid )); ibuf += sizeof( vid ); - if (( vol = getvolbyvid( vid )) == NULL ) { + if (NULL == ( vol = getvolbyvid( vid )) ) { return( AFPERR_PARAM ); } memcpy( &did, ibuf, sizeof( did )); ibuf += sizeof( did ); - if (( dir = dirlookup( vol, did )) == NULL ) { + if (NULL == ( dir = dirlookup( vol, did )) ) { return afp_errno; } @@ -177,7 +177,7 @@ int ibuflen, *rbuflen; dbitmap = ntohs( dbitmap ); ibuf += sizeof( dbitmap ); - if (( s_path = cname( vol, dir, &ibuf )) == NULL) { + if (NULL == ( s_path = cname( vol, dir, &ibuf )) ) { return afp_errno; } @@ -254,7 +254,7 @@ int ibuflen, *rbuflen; memcpy( &vid, ibuf, sizeof(vid)); ibuf += sizeof( vid ); - if (( vol = getvolbyvid( vid )) == NULL ) { + if (NULL == ( vol = getvolbyvid( vid )) ) { return( AFPERR_PARAM ); } @@ -465,7 +465,7 @@ int ibuflen, *rbuflen; memcpy( &vid, ibuf, sizeof( vid )); ibuf += sizeof( vid ); - if (( vol = getvolbyvid( vid )) == NULL ) { + if (NULL == ( vol = getvolbyvid( vid )) ) { return( AFPERR_PARAM ); } @@ -474,7 +474,7 @@ int ibuflen, *rbuflen; memcpy( &did, ibuf, sizeof( did )); ibuf += sizeof( did ); - if (( sdir = dirlookup( vol, did )) == NULL ) { + if (NULL == ( sdir = dirlookup( vol, did )) ) { return afp_errno; } @@ -545,7 +545,7 @@ int ibuflen, *rbuflen; memcpy( &vid, ibuf, sizeof( vid )); ibuf += sizeof( vid ); - if (( vol = getvolbyvid( vid )) == NULL ) { + if (NULL == ( vol = getvolbyvid( vid )) ) { return( AFPERR_PARAM ); } @@ -554,7 +554,7 @@ int ibuflen, *rbuflen; memcpy( &did, ibuf, sizeof( did )); ibuf += sizeof( int ); - if (( dir = dirlookup( vol, did )) == NULL ) { + if (NULL == ( dir = dirlookup( vol, did )) ) { return afp_errno; } @@ -567,7 +567,7 @@ int ibuflen, *rbuflen; rc = deletecurdir( vol, obj->oldtmp, AFPOBJ_TMPSIZ); } else if (of_findname(s_path)) { rc = AFPERR_BUSY; - } else if ((rc = deletefile( upath, 1)) == AFP_OK) { + } else if (AFP_OK == (rc = deletefile( upath, 1))) { #ifdef CNID_DB /* get rid of entry */ cnid_t id = cnid_get(vol->v_db, curdir->d_did, upath, strlen(upath)); cnid_delete(vol->v_db, id); @@ -650,7 +650,7 @@ int ibuflen, *rbuflen; memcpy( &vid, ibuf, sizeof( vid )); ibuf += sizeof( vid ); - if (( vol = getvolbyvid( vid )) == NULL ) { + if (NULL == ( vol = getvolbyvid( vid )) ) { return( AFPERR_PARAM ); } @@ -660,7 +660,7 @@ int ibuflen, *rbuflen; /* source did followed by dest did */ memcpy( &did, ibuf, sizeof( did )); ibuf += sizeof( int ); - if (( sdir = dirlookup( vol, did )) == NULL ) { + if (NULL == ( sdir = dirlookup( vol, did )) ) { return( AFPERR_PARAM ); } diff --git a/etc/afpd/fork.c b/etc/afpd/fork.c index c98c6501..32008c1d 100644 --- a/etc/afpd/fork.c +++ b/etc/afpd/fork.c @@ -1,5 +1,5 @@ /* - * $Id: fork.c,v 1.42 2003-01-10 05:29:01 didg Exp $ + * $Id: fork.c,v 1.43 2003-01-12 14:40:01 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -831,7 +831,7 @@ int is64; memcpy(&ofrefnum, ibuf, sizeof( ofrefnum )); ibuf += sizeof( u_short ); - if (( ofork = of_find( ofrefnum )) == NULL ) { + if (NULL == ( ofork = of_find( ofrefnum )) ) { LOG(log_error, logtype_afpd, "afp_read: of_find"); err = AFPERR_PARAM; goto afp_read_err; @@ -1012,7 +1012,7 @@ int ibuflen, *rbuflen; ibuf += 2; memcpy(&vid, ibuf, sizeof(vid)); - if (( vol = getvolbyvid( vid )) == NULL ) { + if (NULL == ( vol = getvolbyvid( vid )) ) { return( AFPERR_PARAM ); } @@ -1411,8 +1411,8 @@ int ibuflen, *rbuflen; } } - if (( ret = getforkparams( ofork, bitmap, - rbuf + sizeof( u_short ), &buflen, attrbits )) != AFP_OK ) { + if (AFP_OK != ( ret = getforkparams( ofork, bitmap, + rbuf + sizeof( u_short ), &buflen, attrbits ))) { return( ret ); } diff --git a/etc/afpd/mangle.c b/etc/afpd/mangle.c index 812f9d5b..dff7e368 100644 --- a/etc/afpd/mangle.c +++ b/etc/afpd/mangle.c @@ -1,5 +1,5 @@ /* - * $Id: mangle.c,v 1.13 2002-12-18 00:17:03 jmarcus Exp $ + * $Id: mangle.c,v 1.14 2003-01-12 14:40:02 didg Exp $ * * Copyright (c) 2002. Joe Marcus Clarke (marcus@marcuscom.com) * All Rights Reserved. See COPYRIGHT. @@ -29,7 +29,7 @@ demangle(const struct vol *vol, char *mfilename) { return mfilename; } - if ((ext = strrchr(mfilename, '.')) != NULL) { + if (NULL != (ext = strrchr(mfilename, '.')) ) { ext_len = strlen(ext); } if (strlen(mangle) != strlen(MANGLE_CHAR) + MANGLE_LENGTH + ext_len) { @@ -63,7 +63,7 @@ mangle(const struct vol *vol, char *filename) { } /* First, attmept to locate a file extension. */ - if ((ext = strrchr(filename, '.')) != NULL) { + if (NULL != (ext = strrchr(filename, '.')) ) { ext_len = strlen(ext); if (ext_len > MAX_EXT_LENGTH) { /* Do some bounds checking to prevent an extension overflow. */ diff --git a/etc/afpd/unix.c b/etc/afpd/unix.c index fa0ee0a7..a19f644d 100644 --- a/etc/afpd/unix.c +++ b/etc/afpd/unix.c @@ -1,5 +1,5 @@ /* - * $Id: unix.c,v 1.41 2003-01-08 15:01:36 didg Exp $ + * $Id: unix.c,v 1.42 2003-01-12 14:40:03 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -651,7 +651,7 @@ static int recursive_chown(const char *path, uid_t uid, gid_t gid) { LOG(log_error, logtype_afpd, "cannot opendir() [%s] (uid = %d): %s\n", path, uid, strerror(errno)); goto recursive_chown_end; } - while ((entry=readdir(odir)) != NULL) { + while (NULL != (entry=readdir(odir)) ) { name = entry->d_name; if (name[0] == '.' && name[1] == '\0') continue; diff --git a/etc/afpd/volume.c b/etc/afpd/volume.c index 62d52267..f5ef2d5a 100644 --- a/etc/afpd/volume.c +++ b/etc/afpd/volume.c @@ -1,5 +1,5 @@ /* - * $Id: volume.c,v 1.45 2003-01-08 15:01:37 didg Exp $ + * $Id: volume.c,v 1.46 2003-01-12 14:40:04 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -539,7 +539,7 @@ FILE *fp; int c; p = buf; - while ((( c = getc( fp )) != EOF ) && ( size > 0 )) { + while ((EOF != ( c = getc( fp )) ) && ( size > 0 )) { if ( c == '\n' || c == '\r' ) { *p++ = '\n'; break; @@ -706,7 +706,7 @@ struct passwd *pwent; strcat( path, p2 ); } - if (( fp = fopen( path, "r" )) == NULL ) { + if (NULL == ( fp = fopen( path, "r" )) ) { return( -1 ); } @@ -1298,7 +1298,7 @@ int ibuflen, *rbuflen; *rbuflen = 0; ibuf += 2; memcpy(&vid, ibuf, sizeof( vid )); - if (( vol = getvolbyvid( vid )) == NULL ) { + if (NULL == ( vol = getvolbyvid( vid )) ) { return( AFPERR_PARAM ); } @@ -1355,7 +1355,7 @@ struct extmap *getextmap(const char *path) char *p; struct extmap *em; - if (( p = strrchr( path, '.' )) == NULL ) { + if (NULL == ( p = strrchr( path, '.' )) ) { return( defextmap ); } p++; @@ -1451,7 +1451,7 @@ int ibuflen, *rbuflen; memcpy(&bitmap, ibuf, sizeof( bitmap )); bitmap = ntohs( bitmap ); - if (( vol = getvolbyvid( vid )) == NULL ) { + if (NULL == ( vol = getvolbyvid( vid )) ) { *rbuflen = 0; return( AFPERR_PARAM ); } diff --git a/libatalk/adouble/ad_open.c b/libatalk/adouble/ad_open.c index 74ead26f..29eda2f0 100644 --- a/libatalk/adouble/ad_open.c +++ b/libatalk/adouble/ad_open.c @@ -1,5 +1,5 @@ /* - * $Id: ad_open.c,v 1.24 2002-11-26 18:48:23 didg Exp $ + * $Id: ad_open.c,v 1.25 2003-01-12 14:40:04 didg Exp $ * * Copyright (c) 1999 Adrian Sun (asun@u.washington.edu) * Copyright (c) 1990,1991 Regents of The University of Michigan. @@ -483,7 +483,7 @@ ad_path( path, adflags ) } slash = ".Parent"; } else { - if (( slash = strrchr( buf, '/' )) != NULL ) { + if (NULL != ( slash = strrchr( buf, '/' )) ) { c = *++slash; *slash = '\0'; strncpy( pathbuf, buf, MAXPATHLEN); @@ -524,7 +524,7 @@ char * For a path which is just a filename, use "." instead. */ strcpy( modebuf, path ); - if (( slash = strrchr( modebuf, '/' )) != NULL ) { + if (NULL != ( slash = strrchr( modebuf, '/' )) ) { *slash = '\0'; /* remove pathname component */ } else { modebuf[0] = '.'; /* use current directory */ @@ -672,7 +672,7 @@ int ad_open( path, adflags, oflags, mode, ad ) * mkdir it. */ if (errno == ENOENT && (adflags & ADFLAGS_NOADOUBLE) == 0) { - if (( slash = strrchr( ad_p, '/' )) == NULL ) { + if (NULL == ( slash = strrchr( ad_p, '/' )) ) { ad_close( ad, adflags ); return( -1 ); } diff --git a/libatalk/dsi/dsi_stream.c b/libatalk/dsi/dsi_stream.c index 54b6d456..f2d76cd4 100644 --- a/libatalk/dsi/dsi_stream.c +++ b/libatalk/dsi/dsi_stream.c @@ -1,5 +1,5 @@ /* - * $Id: dsi_stream.c,v 1.9 2002-10-11 14:18:39 didg Exp $ + * $Id: dsi_stream.c,v 1.10 2003-01-12 14:40:05 didg Exp $ * * Copyright (c) 1998 Adrian Sun (asun@zoology.washington.edu) * All rights reserved. See COPYRIGHT. @@ -46,8 +46,8 @@ size_t dsi_stream_write(DSI *dsi, void *data, const size_t length) written = 0; while (written < length) { - if (((len = write(dsi->socket, (u_int8_t *) data + written, - length - written)) == -1 && errno == EINTR) || + if ((-1 == (len = write(dsi->socket, (u_int8_t *) data + written, + length - written)) && errno == EINTR) || !len) continue;