diff --git a/src/xpath.c b/src/xpath.c
index 0f5c744..4072aab 100644
--- a/src/xpath.c
+++ b/src/xpath.c
@@ -995,7 +995,7 @@
 
     orig_used = set->used;
     set->used = 0;
-    for (i = 0; i < orig_used;) {
+    for (i = 0; i < orig_used; ) {
         start = -1;
         do {
             if ((set->val.nodes[i].type != LYXP_NODE_NONE) && (start == -1)) {
@@ -1595,7 +1595,7 @@
 
     /* find first top-level node to be used as anchor for positions */
     for (root = set->ctx_node; root->parent; root = (const struct lyd_node *)root->parent) {}
-    for (; root->prev->next; root = root->prev) {}
+    for ( ; root->prev->next; root = root->prev) {}
 
     /* fill positions */
     if (set_assign_pos(set, root, set->root_type)) {
@@ -1715,7 +1715,7 @@
 
     /* find first top-level node to be used as anchor for positions */
     for (root = trg->ctx_node; root->parent; root = (const struct lyd_node *)root->parent) {}
-    for (; root->prev->next; root = root->prev) {}
+    for ( ; root->prev->next; root = root->prev) {}
 
     /* fill positions */
     if (set_assign_pos(trg, root, trg->root_type) || set_assign_pos(src, root, src->root_type)) {
@@ -2774,7 +2774,7 @@
             for (tok_len = 0; isdigit(expr[parsed + tok_len]); ++tok_len) {}
             if (expr[parsed + tok_len] == '.') {
                 ++tok_len;
-                for (; isdigit(expr[parsed + tok_len]); ++tok_len) {}
+                for ( ; isdigit(expr[parsed + tok_len]); ++tok_len) {}
             }
             tok_type = LYXP_TOKEN_NUMBER;
 
@@ -2789,7 +2789,7 @@
                 tok_type = LYXP_TOKEN_OPER_PATH;
             }
 
-        } else if  (!strncmp(&expr[parsed], "!=", 2)) {
+        } else if (!strncmp(&expr[parsed], "!=", 2)) {
 
             /* Operator '!=' */
             tok_len = 2;
@@ -4009,7 +4009,7 @@
     }
 
     /* find lang metadata */
-    for (; node; node = (struct lyd_node *)node->parent) {
+    for ( ; node; node = (struct lyd_node *)node->parent) {
         for (meta = node->meta; meta; meta = meta->next) {
             /* annotations */
             if (meta->name && !strcmp(meta->name, "lang") && !strcmp(meta->annotation->module->name, "xml")) {
@@ -5070,7 +5070,7 @@
         return LY_EVALID;
     }
 
-    for (i = 0; i < set->used;) {
+    for (i = 0; i < set->used; ) {
         switch (set->val.nodes[i].type) {
         case LYXP_NODE_NONE:
             LOGINT_RET(set->ctx);
@@ -8289,7 +8289,7 @@
     }
 
     op = ctx_node ? ctx_node->schema : NULL;
-    for (; op && !(op->nodetype & (LYS_RPC | LYS_ACTION | LYS_NOTIF)); op = op->parent) {}
+    for ( ; op && !(op->nodetype & (LYS_RPC | LYS_ACTION | LYS_NOTIF)); op = op->parent) {}
 
     if (!ctx_node || (!op && (ctx_node->schema->flags & LYS_CONFIG_W))) {
         /* root context node can access only config data (because we said so, it is unspecified) */
