Commit Diff


commit - f987c90b41240068719f2c9e5638fbd442adfdad
commit + 39c864a48b9d156c8b748725f5f89b3bd3f65038
blob - 94bf306447c1f76eadeb7357e88c4c7b6fce7790
blob + 26af2f2535488277861a555a77b409586c5ada8e
--- got/got.c
+++ got/got.c
@@ -5969,7 +5969,7 @@ print_entry(struct got_tree_entry *te, const char *id,
 		err = got_tree_entry_get_symlink_target(&link_target, te, repo);
 		if (err)
 			return err;
-		for (i = 0; i < strlen(link_target); i++) {
+		for (i = 0; link_target[i] != '\0'; i++) {
 			if (!isprint((unsigned char)link_target[i]))
 				link_target[i] = '?';
 		}
@@ -6326,7 +6326,7 @@ cmd_status(int argc, char *argv[])
 			st.suppress = 1;
 			/* fallthrough */
 		case 's':
-			for (i = 0; i < strlen(optarg); i++) {
+			for (i = 0; optarg[i] != '\0'; i++) {
 				switch (optarg[i]) {
 				case GOT_STATUS_MODIFY:
 				case GOT_STATUS_ADD:
@@ -7989,7 +7989,7 @@ cmd_remove(int argc, char *argv[])
 			can_recurse = 1;
 			break;
 		case 's':
-			for (i = 0; i < strlen(optarg); i++) {
+			for (i = 0; optarg[i] != '\0'; i++) {
 				switch (optarg[i]) {
 				case GOT_STATUS_MODIFY:
 					delete_local_mods = 1;
blob - d694a6164057730509b8e3db4e24c4ae1ef16c64
blob + 50c38cd6d28d539dcfa273bc3233bbda7f02fe7a
--- tog/tog.c
+++ tog/tog.c
@@ -7304,7 +7304,7 @@ draw_tree_entries(struct tog_view *view, const char *p
 				free(id_str);
 				return err;
 			}
-			for (i = 0; i < strlen(link_target); i++) {
+			for (i = 0; i < link_target[i] != '\0'; i++) {
 				if (!isprint((unsigned char)link_target[i]))
 					link_target[i] = '?';
 			}