mirror of
https://gitlab.com/qemu-project/openbios.git
synced 2024-02-13 08:34:06 +08:00
Fix gcc and Sparse warnings generated by r301
git-svn-id: svn://coreboot.org/openbios/openbios-devel@302 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
@@ -41,8 +41,8 @@ int b_init(hfsvol *vol)
|
||||
ASSERT(vol->cache == 0);
|
||||
|
||||
cache = ALLOC(bcache, 1);
|
||||
if (cache == 0)
|
||||
ERROR(ENOMEM, 0);
|
||||
if (cache == NULL)
|
||||
ERROR(ENOMEM, NULL);
|
||||
|
||||
vol->cache = cache;
|
||||
|
||||
@@ -65,15 +65,15 @@ int b_init(hfsvol *vol)
|
||||
b->cnext = b + 1;
|
||||
b->cprev = b - 1;
|
||||
|
||||
b->hnext = 0;
|
||||
b->hprev = 0;
|
||||
b->hnext = NULL;
|
||||
b->hprev = NULL;
|
||||
}
|
||||
|
||||
cache->chain[0].cprev = cache->tail;
|
||||
cache->tail->cnext = &cache->chain[0];
|
||||
|
||||
for (i = 0; i < HFS_HASHSZ; ++i)
|
||||
cache->hash[i] = 0;
|
||||
cache->hash[i] = NULL;
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -259,7 +259,7 @@ int b_finish(hfsvol *vol)
|
||||
{
|
||||
int result = 0;
|
||||
|
||||
if (vol->cache == 0)
|
||||
if (vol->cache == NULL)
|
||||
goto done;
|
||||
|
||||
# ifdef DEBUG
|
||||
@@ -267,7 +267,7 @@ int b_finish(hfsvol *vol)
|
||||
# endif
|
||||
|
||||
FREE(vol->cache);
|
||||
vol->cache = 0;
|
||||
vol->cache = NULL;
|
||||
|
||||
done:
|
||||
return result;
|
||||
@@ -469,7 +469,7 @@ bucket *getbucket(bcache *cache, unsigned long bnum, int fill)
|
||||
return b;
|
||||
|
||||
fail:
|
||||
return 0;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -524,7 +524,7 @@ int b_readlb(hfsvol *vol, unsigned long bnum, block *bp)
|
||||
bucket *b;
|
||||
|
||||
b = getbucket(vol->cache, bnum, 1);
|
||||
if (b == 0)
|
||||
if (b == NULL)
|
||||
goto fail;
|
||||
|
||||
memcpy(bp, b->data, HFS_BLOCKSZ);
|
||||
|
||||
@@ -89,7 +89,7 @@ fail:
|
||||
int bt_readhdr(btree *bt)
|
||||
{
|
||||
const byte *ptr;
|
||||
byte *map = 0;
|
||||
byte *map = NULL;
|
||||
int i;
|
||||
unsigned long nnum;
|
||||
|
||||
@@ -128,8 +128,8 @@ int bt_readhdr(btree *bt)
|
||||
/* don't set bt->map until we're done, since getnode() checks it */
|
||||
|
||||
map = ALLOC(byte, HFS_MAP1SZ);
|
||||
if (map == 0)
|
||||
ERROR(ENOMEM, 0);
|
||||
if (map == NULL)
|
||||
ERROR(ENOMEM, NULL);
|
||||
|
||||
memcpy(map, HFS_NODEREC(bt->hdrnd, 2), HFS_MAP1SZ);
|
||||
bt->mapsz = HFS_MAP1SZ;
|
||||
@@ -153,8 +153,8 @@ int bt_readhdr(btree *bt)
|
||||
ERROR(EIO, "malformed b*-tree map node");
|
||||
|
||||
newmap = REALLOC(map, byte, bt->mapsz + HFS_MAPXSZ);
|
||||
if (newmap == 0)
|
||||
ERROR(ENOMEM, 0);
|
||||
if (newmap == NULL)
|
||||
ERROR(ENOMEM, NULL);
|
||||
|
||||
map = newmap;
|
||||
|
||||
@@ -186,7 +186,7 @@ int bt_search(btree *bt, const byte *key, node *np)
|
||||
nnum = bt->hdr.bthRoot;
|
||||
|
||||
if (nnum == 0)
|
||||
ERROR(ENOENT, 0);
|
||||
ERROR(ENOENT, NULL);
|
||||
|
||||
while (1)
|
||||
{
|
||||
@@ -204,7 +204,7 @@ int bt_search(btree *bt, const byte *key, node *np)
|
||||
{
|
||||
case ndIndxNode:
|
||||
if (np->rnum == -1)
|
||||
ERROR(ENOENT, 0);
|
||||
ERROR(ENOENT, NULL);
|
||||
|
||||
rec = HFS_NODEREC(*np, np->rnum);
|
||||
nnum = d_getul(HFS_RECDATA(rec));
|
||||
@@ -213,7 +213,7 @@ int bt_search(btree *bt, const byte *key, node *np)
|
||||
|
||||
case ndLeafNode:
|
||||
if (! found)
|
||||
ERROR(ENOENT, 0);
|
||||
ERROR(ENOENT, NULL);
|
||||
|
||||
goto done;
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
static
|
||||
time_t tzdiff = -1;
|
||||
|
||||
const
|
||||
static const
|
||||
unsigned char hfs_charorder[256] = {
|
||||
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
|
||||
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
|
||||
|
||||
@@ -86,8 +86,8 @@ void f_init(hfsfile *file, hfsvol *vol, long cnid, const char *name)
|
||||
|
||||
file->flags = 0;
|
||||
|
||||
file->prev = 0;
|
||||
file->next = 0;
|
||||
file->prev = NULL;
|
||||
file->next = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -156,7 +156,7 @@ int f_doblock(hfsfile *file, unsigned long num, block *bp,
|
||||
{
|
||||
ExtDataRec *extrec;
|
||||
|
||||
f_getptrs(file, &extrec, 0, 0);
|
||||
f_getptrs(file, &extrec, NULL, NULL);
|
||||
|
||||
fabn = file->fabn = 0;
|
||||
memcpy(&file->ext, extrec, sizeof(ExtDataRec));
|
||||
@@ -179,7 +179,7 @@ int f_doblock(hfsfile *file, unsigned long num, block *bp,
|
||||
abnum -= n;
|
||||
}
|
||||
|
||||
if (v_extsearch(file, fabn, &file->ext, 0) <= 0)
|
||||
if (v_extsearch(file, fabn, &file->ext, NULL) <= 0)
|
||||
goto fail;
|
||||
|
||||
file->fabn = fabn;
|
||||
|
||||
72
fs/hfs/hfs.c
72
fs/hfs/hfs.c
@@ -45,9 +45,9 @@ hfsvol *curvol; /* current volume */
|
||||
static
|
||||
int getvol(hfsvol **vol)
|
||||
{
|
||||
if (*vol == 0)
|
||||
if (*vol == NULL)
|
||||
{
|
||||
if (curvol == 0)
|
||||
if (curvol == NULL)
|
||||
ERROR(EINVAL, "no volume is current");
|
||||
|
||||
*vol = curvol;
|
||||
@@ -81,8 +81,8 @@ hfsvol *hfs_mount( int os_fd, int pnum)
|
||||
}
|
||||
|
||||
vol = ALLOC(hfsvol, 1);
|
||||
if (vol == 0)
|
||||
ERROR(ENOMEM, 0);
|
||||
if (vol == NULL)
|
||||
ERROR(ENOMEM, NULL);
|
||||
|
||||
v_init(vol, mode);
|
||||
|
||||
@@ -98,7 +98,7 @@ hfsvol *hfs_mount( int os_fd, int pnum)
|
||||
|
||||
/* add to linked list of volumes */
|
||||
|
||||
vol->prev = 0;
|
||||
vol->prev = NULL;
|
||||
vol->next = hfs_mounts;
|
||||
|
||||
if (hfs_mounts)
|
||||
@@ -119,7 +119,7 @@ fail:
|
||||
FREE(vol);
|
||||
}
|
||||
|
||||
return 0;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -168,7 +168,7 @@ int hfs_umount(hfsvol *vol)
|
||||
if (vol == hfs_mounts)
|
||||
hfs_mounts = vol->next;
|
||||
if (vol == curvol)
|
||||
curvol = 0;
|
||||
curvol = NULL;
|
||||
|
||||
FREE(vol);
|
||||
|
||||
@@ -197,7 +197,7 @@ hfsvol *hfs_getvol(const char *name)
|
||||
{
|
||||
hfsvol *vol;
|
||||
|
||||
if (name == 0)
|
||||
if (name == NULL)
|
||||
return curvol;
|
||||
|
||||
for (vol = hfs_mounts; vol; vol = vol->next)
|
||||
@@ -206,7 +206,7 @@ hfsvol *hfs_getvol(const char *name)
|
||||
return vol;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -264,11 +264,11 @@ int hfs_chdir(hfsvol *vol, const char *path)
|
||||
CatDataRec data;
|
||||
|
||||
if (getvol(&vol) == -1 ||
|
||||
v_resolve(&vol, path, &data, 0, 0, 0) <= 0)
|
||||
v_resolve(&vol, path, &data, NULL, NULL, NULL) <= 0)
|
||||
goto fail;
|
||||
|
||||
if (data.cdrType != cdrDirRec)
|
||||
ERROR(ENOTDIR, 0);
|
||||
ERROR(ENOTDIR, NULL);
|
||||
|
||||
vol->cwd = data.u.dir.dirDirID;
|
||||
|
||||
@@ -304,7 +304,7 @@ int hfs_setcwd(hfsvol *vol, unsigned long id)
|
||||
|
||||
/* make sure the directory exists */
|
||||
|
||||
if (v_getdthread(vol, id, 0, 0) <= 0)
|
||||
if (v_getdthread(vol, id, NULL, NULL) <= 0)
|
||||
goto fail;
|
||||
|
||||
vol->cwd = id;
|
||||
@@ -325,7 +325,7 @@ int hfs_dirinfo(hfsvol *vol, unsigned long *id, char *name)
|
||||
CatDataRec thread;
|
||||
|
||||
if (getvol(&vol) == -1 ||
|
||||
v_getdthread(vol, *id, &thread, 0) <= 0)
|
||||
v_getdthread(vol, *id, &thread, NULL) <= 0)
|
||||
goto fail;
|
||||
|
||||
*id = thread.u.dthd.thdParID;
|
||||
@@ -345,7 +345,7 @@ fail:
|
||||
*/
|
||||
hfsdir *hfs_opendir(hfsvol *vol, const char *path)
|
||||
{
|
||||
hfsdir *dir = 0;
|
||||
hfsdir *dir = NULL;
|
||||
CatKeyRec key;
|
||||
CatDataRec data;
|
||||
byte pkey[HFS_CATKEYLEN];
|
||||
@@ -354,8 +354,8 @@ hfsdir *hfs_opendir(hfsvol *vol, const char *path)
|
||||
goto fail;
|
||||
|
||||
dir = ALLOC(hfsdir, 1);
|
||||
if (dir == 0)
|
||||
ERROR(ENOMEM, 0);
|
||||
if (dir == NULL)
|
||||
ERROR(ENOMEM, NULL);
|
||||
|
||||
dir->vol = vol;
|
||||
|
||||
@@ -368,23 +368,23 @@ hfsdir *hfs_opendir(hfsvol *vol, const char *path)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (v_resolve(&vol, path, &data, 0, 0, 0) <= 0)
|
||||
if (v_resolve(&vol, path, &data, NULL, NULL, NULL) <= 0)
|
||||
goto fail;
|
||||
|
||||
if (data.cdrType != cdrDirRec)
|
||||
ERROR(ENOTDIR, 0);
|
||||
ERROR(ENOTDIR, NULL);
|
||||
|
||||
dir->dirid = data.u.dir.dirDirID;
|
||||
dir->vptr = 0;
|
||||
dir->vptr = NULL;
|
||||
|
||||
r_makecatkey(&key, dir->dirid, "");
|
||||
r_packcatkey(&key, pkey, 0);
|
||||
r_packcatkey(&key, pkey, NULL);
|
||||
|
||||
if (bt_search(&vol->cat, pkey, &dir->n) <= 0)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
dir->prev = 0;
|
||||
dir->prev = NULL;
|
||||
dir->next = vol->dirs;
|
||||
|
||||
if (vol->dirs)
|
||||
@@ -396,7 +396,7 @@ hfsdir *hfs_opendir(hfsvol *vol, const char *path)
|
||||
|
||||
fail:
|
||||
FREE(dir);
|
||||
return 0;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -420,12 +420,12 @@ int hfs_readdir(hfsdir *dir, hfsdirent *ent)
|
||||
break;
|
||||
}
|
||||
|
||||
if (vol == 0)
|
||||
if (vol == NULL)
|
||||
ERROR(ENOENT, "no more entries");
|
||||
|
||||
if (v_getdthread(vol, HFS_CNID_ROOTDIR, &data, 0) <= 0 ||
|
||||
if (v_getdthread(vol, HFS_CNID_ROOTDIR, &data, NULL) <= 0 ||
|
||||
v_catsearch(vol, HFS_CNID_ROOTPAR, data.u.dthd.thdCName,
|
||||
&data, cname, 0) <= 0)
|
||||
&data, cname, NULL) <= 0)
|
||||
goto fail;
|
||||
|
||||
r_unpackdirent(HFS_CNID_ROOTPAR, cname, &data, ent);
|
||||
@@ -523,20 +523,20 @@ int hfs_closedir(hfsdir *dir)
|
||||
*/
|
||||
hfsfile *hfs_open(hfsvol *vol, const char *path)
|
||||
{
|
||||
hfsfile *file = 0;
|
||||
hfsfile *file = NULL;
|
||||
|
||||
if (getvol(&vol) == -1)
|
||||
goto fail;
|
||||
|
||||
file = ALLOC(hfsfile, 1);
|
||||
if (file == 0)
|
||||
ERROR(ENOMEM, 0);
|
||||
if (file == NULL)
|
||||
ERROR(ENOMEM, NULL);
|
||||
|
||||
if (v_resolve(&vol, path, &file->cat, &file->parid, file->name, 0) <= 0)
|
||||
if (v_resolve(&vol, path, &file->cat, &file->parid, file->name, NULL) <= 0)
|
||||
goto fail;
|
||||
|
||||
if (file->cat.cdrType != cdrFilRec)
|
||||
ERROR(EISDIR, 0);
|
||||
ERROR(EISDIR, NULL);
|
||||
|
||||
/* package file handle for user */
|
||||
|
||||
@@ -545,7 +545,7 @@ hfsfile *hfs_open(hfsvol *vol, const char *path)
|
||||
|
||||
f_selectfork(file, fkData);
|
||||
|
||||
file->prev = 0;
|
||||
file->prev = NULL;
|
||||
file->next = vol->files;
|
||||
|
||||
if (vol->files)
|
||||
@@ -557,7 +557,7 @@ hfsfile *hfs_open(hfsvol *vol, const char *path)
|
||||
|
||||
fail:
|
||||
FREE(file);
|
||||
return 0;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -591,7 +591,7 @@ unsigned long hfs_read(hfsfile *file, void *buf, unsigned long len)
|
||||
unsigned long *lglen, count;
|
||||
byte *ptr = buf;
|
||||
|
||||
f_getptrs(file, 0, &lglen, 0);
|
||||
f_getptrs(file, NULL, &lglen, NULL);
|
||||
|
||||
if (file->pos + len > *lglen)
|
||||
len = *lglen - file->pos;
|
||||
@@ -643,7 +643,7 @@ unsigned long hfs_seek(hfsfile *file, long offset, int from)
|
||||
{
|
||||
unsigned long *lglen, newpos;
|
||||
|
||||
f_getptrs(file, 0, &lglen, 0);
|
||||
f_getptrs(file, NULL, &lglen, NULL);
|
||||
|
||||
switch (from)
|
||||
{
|
||||
@@ -666,7 +666,7 @@ unsigned long hfs_seek(hfsfile *file, long offset, int from)
|
||||
break;
|
||||
|
||||
default:
|
||||
ERROR(EINVAL, 0);
|
||||
ERROR(EINVAL, NULL);
|
||||
}
|
||||
|
||||
if (newpos > *lglen)
|
||||
@@ -714,7 +714,7 @@ int hfs_stat(hfsvol *vol, const char *path, hfsdirent *ent)
|
||||
char name[HFS_MAX_FLEN + 1];
|
||||
|
||||
if (getvol(&vol) == -1 ||
|
||||
v_resolve(&vol, path, &data, &parid, name, 0) <= 0)
|
||||
v_resolve(&vol, path, &data, &parid, name, NULL) <= 0)
|
||||
goto fail;
|
||||
|
||||
r_unpackdirent(parid, name, &data, ent);
|
||||
|
||||
@@ -288,7 +288,7 @@ close_fs( fs_ops_t *fs )
|
||||
/* callers responsibility to call free(fs) */
|
||||
}
|
||||
|
||||
static char *
|
||||
static const char *
|
||||
get_fstype( fs_ops_t *fs )
|
||||
{
|
||||
return ("HFS");
|
||||
|
||||
@@ -19,8 +19,6 @@
|
||||
* $Id: data.h,v 1.7 1998/11/02 22:08:58 rob Exp $
|
||||
*/
|
||||
|
||||
extern const unsigned char hfs_charorder[];
|
||||
|
||||
signed char d_getsb(register const unsigned char *);
|
||||
unsigned char d_getub(register const unsigned char *);
|
||||
signed short d_getsw(register const unsigned char *);
|
||||
|
||||
@@ -22,8 +22,6 @@
|
||||
# include "hfs.h"
|
||||
# include "apple.h"
|
||||
|
||||
extern int errno;
|
||||
|
||||
# define ERROR(code, str) \
|
||||
do { hfs_error = (str), errno = (code); goto fail; } while (0)
|
||||
|
||||
|
||||
@@ -57,7 +57,8 @@ int v_putextrec(const ExtDataRec *, node *);
|
||||
int v_allocblocks(hfsvol *, ExtDescriptor *);
|
||||
int v_freeblocks(hfsvol *, const ExtDescriptor *);
|
||||
|
||||
int v_resolve(hfsvol **, const char *, CatDataRec *, long *, char *, node *);
|
||||
int v_resolve(hfsvol **vol, const char *path,
|
||||
CatDataRec *data, unsigned long *parid, char *fname, node *np);
|
||||
|
||||
int v_adjvalence(hfsvol *, unsigned long, int, int);
|
||||
int v_mkdir(hfsvol *, unsigned long, const char *);
|
||||
|
||||
@@ -48,14 +48,14 @@ void v_init(hfsvol *vol, int flags)
|
||||
vol->vlen = 0;
|
||||
vol->lpa = 0;
|
||||
|
||||
vol->cache = 0;
|
||||
vol->cache = NULL;
|
||||
|
||||
vol->vbm = 0;
|
||||
vol->vbm = NULL;
|
||||
vol->vbmsz = 0;
|
||||
|
||||
f_init(&ext->f, vol, HFS_CNID_EXT, "extents overflow");
|
||||
|
||||
ext->map = 0;
|
||||
ext->map = NULL;
|
||||
ext->mapsz = 0;
|
||||
ext->flags = 0;
|
||||
|
||||
@@ -64,7 +64,7 @@ void v_init(hfsvol *vol, int flags)
|
||||
|
||||
f_init(&cat->f, vol, HFS_CNID_CAT, "catalog");
|
||||
|
||||
cat->map = 0;
|
||||
cat->map = NULL;
|
||||
cat->mapsz = 0;
|
||||
cat->flags = 0;
|
||||
|
||||
@@ -74,11 +74,11 @@ void v_init(hfsvol *vol, int flags)
|
||||
vol->cwd = HFS_CNID_ROOTDIR;
|
||||
|
||||
vol->refs = 0;
|
||||
vol->files = 0;
|
||||
vol->dirs = 0;
|
||||
vol->files = NULL;
|
||||
vol->dirs = NULL;
|
||||
|
||||
vol->prev = 0;
|
||||
vol->next = 0;
|
||||
vol->prev = NULL;
|
||||
vol->next = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -126,14 +126,14 @@ int v_close(hfsvol *vol)
|
||||
|
||||
FREE(vol->vbm);
|
||||
|
||||
vol->vbm = 0;
|
||||
vol->vbm = NULL;
|
||||
vol->vbmsz = 0;
|
||||
|
||||
FREE(vol->ext.map);
|
||||
FREE(vol->cat.map);
|
||||
|
||||
vol->ext.map = 0;
|
||||
vol->cat.map = 0;
|
||||
vol->ext.map = NULL;
|
||||
vol->cat.map = NULL;
|
||||
|
||||
done:
|
||||
return result;
|
||||
@@ -275,8 +275,8 @@ int v_readvbm(hfsvol *vol)
|
||||
ERROR(EIO, "volume bitmap collides with volume data");
|
||||
|
||||
vol->vbm = ALLOC(block, vbmsz);
|
||||
if (vol->vbm == 0)
|
||||
ERROR(ENOMEM, 0);
|
||||
if (vol->vbm == NULL)
|
||||
ERROR(ENOMEM, NULL);
|
||||
|
||||
vol->vbmsz = vbmsz;
|
||||
|
||||
@@ -291,7 +291,7 @@ int v_readvbm(hfsvol *vol)
|
||||
fail:
|
||||
FREE(vol->vbm);
|
||||
|
||||
vol->vbm = 0;
|
||||
vol->vbm = NULL;
|
||||
vol->vbmsz = 0;
|
||||
|
||||
return -1;
|
||||
@@ -339,11 +339,11 @@ int v_catsearch(hfsvol *vol, unsigned long parid, const char *name,
|
||||
node n;
|
||||
int found;
|
||||
|
||||
if (np == 0)
|
||||
if (np == NULL)
|
||||
np = &n;
|
||||
|
||||
r_makecatkey(&key, parid, name);
|
||||
r_packcatkey(&key, pkey, 0);
|
||||
r_packcatkey(&key, pkey, NULL);
|
||||
|
||||
found = bt_search(&vol->cat, pkey, np);
|
||||
if (found <= 0)
|
||||
@@ -378,11 +378,11 @@ int v_extsearch(hfsfile *file, unsigned int fabn,
|
||||
node n;
|
||||
int found;
|
||||
|
||||
if (np == 0)
|
||||
if (np == NULL)
|
||||
np = &n;
|
||||
|
||||
r_makeextkey(&key, file->fork, file->cat.u.fil.filFlNum, fabn);
|
||||
r_packextkey(&key, pkey, 0);
|
||||
r_packextkey(&key, pkey, NULL);
|
||||
|
||||
/* in case bt_search() clobbers these */
|
||||
|
||||
@@ -416,10 +416,10 @@ int v_getthread(hfsvol *vol, unsigned long id,
|
||||
CatDataRec rec;
|
||||
int found;
|
||||
|
||||
if (thread == 0)
|
||||
if (thread == NULL)
|
||||
thread = &rec;
|
||||
|
||||
found = v_catsearch(vol, id, "", thread, 0, np);
|
||||
found = v_catsearch(vol, id, "", thread, NULL, np);
|
||||
if (found == 1 && thread->cdrType != type)
|
||||
ERROR(EIO, "bad thread record");
|
||||
|
||||
@@ -435,7 +435,7 @@ fail:
|
||||
* DESCRIPTION: translate a pathname; return catalog information
|
||||
*/
|
||||
int v_resolve(hfsvol **vol, const char *path,
|
||||
CatDataRec *data, long *parid, char *fname, node *np)
|
||||
CatDataRec *data, unsigned long *parid, char *fname, node *np)
|
||||
{
|
||||
unsigned long dirid;
|
||||
char name[HFS_MAX_FLEN + 1], *nptr;
|
||||
@@ -449,7 +449,7 @@ int v_resolve(hfsvol **vol, const char *path,
|
||||
|
||||
nptr = strchr(path, ':');
|
||||
|
||||
if (*path == ':' || nptr == 0)
|
||||
if (*path == ':' || nptr == NULL)
|
||||
{
|
||||
dirid = (*vol)->cwd; /* relative path */
|
||||
|
||||
@@ -458,7 +458,7 @@ int v_resolve(hfsvol **vol, const char *path,
|
||||
|
||||
if (*path == 0)
|
||||
{
|
||||
found = v_getdthread(*vol, dirid, data, 0);
|
||||
found = v_getdthread(*vol, dirid, data, NULL);
|
||||
if (found == -1)
|
||||
goto fail;
|
||||
|
||||
@@ -483,7 +483,7 @@ int v_resolve(hfsvol **vol, const char *path,
|
||||
dirid = HFS_CNID_ROOTPAR; /* absolute path */
|
||||
|
||||
if (nptr - path > HFS_MAX_VLEN)
|
||||
ERROR(ENAMETOOLONG, 0);
|
||||
ERROR(ENAMETOOLONG, NULL);
|
||||
|
||||
strncpy(name, path, nptr - path);
|
||||
name[nptr - path] = 0;
|
||||
@@ -504,7 +504,7 @@ int v_resolve(hfsvol **vol, const char *path,
|
||||
{
|
||||
++path;
|
||||
|
||||
found = v_getdthread(*vol, dirid, data, 0);
|
||||
found = v_getdthread(*vol, dirid, data, NULL);
|
||||
if (found == -1)
|
||||
goto fail;
|
||||
else if (! found)
|
||||
@@ -515,7 +515,7 @@ int v_resolve(hfsvol **vol, const char *path,
|
||||
|
||||
if (*path == 0)
|
||||
{
|
||||
found = v_getdthread(*vol, dirid, data, 0);
|
||||
found = v_getdthread(*vol, dirid, data, NULL);
|
||||
if (found == -1)
|
||||
goto fail;
|
||||
|
||||
@@ -538,7 +538,7 @@ int v_resolve(hfsvol **vol, const char *path,
|
||||
*nptr++ = *path++;
|
||||
|
||||
if (*path && *path != ':')
|
||||
ERROR(ENAMETOOLONG, 0);
|
||||
ERROR(ENAMETOOLONG, NULL);
|
||||
|
||||
*nptr = 0;
|
||||
if (*path == ':')
|
||||
|
||||
Reference in New Issue
Block a user