aboutsummaryrefslogtreecommitdiffstats
path: root/module/zcommon/zfs_namecheck.c
diff options
context:
space:
mode:
authorDon Brady <[email protected]>2017-11-04 14:25:13 -0600
committerBrian Behlendorf <[email protected]>2017-11-04 13:25:13 -0700
commit1c27024e22af4386b592b30d40e6a0820ceb48c1 (patch)
tree689d4b821fd6910a137a0f93351351def5011cec /module/zcommon/zfs_namecheck.c
parentdf1f129bc4150fd6ea3f23a01154a71ffa48bf12 (diff)
Undo c89 workarounds to match with upstream
With PR 5756 the zfs module now supports c99 and the remaining past c89 workarounds can be undone. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: George Melikov <[email protected]> Signed-off-by: Don Brady <[email protected]> Closes #6816
Diffstat (limited to 'module/zcommon/zfs_namecheck.c')
-rw-r--r--module/zcommon/zfs_namecheck.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/module/zcommon/zfs_namecheck.c b/module/zcommon/zfs_namecheck.c
index e8db93be7..42a7c6c93 100644
--- a/module/zcommon/zfs_namecheck.c
+++ b/module/zcommon/zfs_namecheck.c
@@ -136,12 +136,13 @@ permset_namecheck(const char *path, namecheck_err_t *why, char *what)
int
entity_namecheck(const char *path, namecheck_err_t *why, char *what)
{
- const char *start, *end, *loc;
+ const char *start, *end;
int found_delim;
/*
* Make sure the name is not too long.
*/
+
if (strlen(path) >= ZFS_MAX_DATASET_NAME_LEN) {
if (why)
*why = NAME_ERR_TOOLONG;
@@ -178,7 +179,7 @@ entity_namecheck(const char *path, namecheck_err_t *why, char *what)
}
/* Validate the contents of this component */
- for (loc = start; loc != end; loc++) {
+ for (const char *loc = start; loc != end; loc++) {
if (!valid_char(*loc) && *loc != '%') {
if (why) {
*why = NAME_ERR_INVALCHAR;