summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/net_usershare.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source3/utils/net_usershare.c b/source3/utils/net_usershare.c
index 1ee156c4ee..ca9ca4e6e2 100644
--- a/source3/utils/net_usershare.c
+++ b/source3/utils/net_usershare.c
@@ -129,7 +129,7 @@ int net_usershare_usage(int argc, const char **argv)
static void get_basepath(pstring basepath)
{
pstrcpy(basepath, lp_usershare_path());
- if (basepath[strlen(basepath)-1] == '/') {
+ if ((basepath[0] != '\0') && (basepath[strlen(basepath)-1] == '/')) {
basepath[strlen(basepath)-1] = '\0';
}
}