From 92f1f7c12e5aa4f40e9035266c5b88d2567e8477 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 11 Jun 2015 07:18:44 -0600 Subject: [PATCH] Fix test for root directory in inode_reserve --- fs/inode/fs_inodereserve.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/inode/fs_inodereserve.c b/fs/inode/fs_inodereserve.c index f0298cb8bef..fa3934313ac 100644 --- a/fs/inode/fs_inodereserve.c +++ b/fs/inode/fs_inodereserve.c @@ -1,7 +1,7 @@ /**************************************************************************** * fs/inode/fs_registerreserve.c * - * Copyright (C) 2007-2009, 2011-2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011-2012, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -176,7 +176,7 @@ int inode_reserve(FAR const char *path, FAR struct inode **inode) /* Handle paths that are interpreted as the root directory */ - if (!*path || path[0] != '/') + if (path[0] == '\0' || path[0] != '/' || path[1] == '\0') { return -EINVAL; }