Skip to content

Commit fb23bf5

Browse files
committed
nad: refactor argument iteration to use a common syntax
1 parent daccd84 commit fb23bf5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

bin/nad/nad_mv.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,11 +216,13 @@ int ad_mv(int argc, char *argv[], AFPObj *obj)
216216
++baselen;
217217
}
218218

219-
for (rval = 0; --argc; ++argv) {
219+
rval = 0;
220+
221+
for (int i = 0; i < argc; i++) {
220222
/*
221223
* Find the last component of the source pathname using basename
222224
*/
223-
char *src_copy = strdup(*argv);
225+
char *src_copy = strdup(argv[i]);
224226

225227
if (src_copy == NULL) {
226228
SLOG("Memory allocation error");

0 commit comments

Comments
 (0)