Use sizeof() instead of strlen().

This commit is contained in:
Tatsuhiko Kubo
2015-01-03 22:37:11 +09:00
parent 465ce1e528
commit 2b753167ca
2 changed files with 2 additions and 2 deletions
@@ -45,7 +45,7 @@ build_path(mrb_state *mrb, const char *dir, const char *base)
len = strlen(base) + 1;
if (strcmp(dir, ".")) {
len += strlen(dir) + strlen("/");
len += strlen(dir) + sizeof("/") - 1;
}
path = mrb_malloc(mrb, len);
+1 -1
View File
@@ -275,7 +275,7 @@ get_command(mrb_state *mrb, mrdb_state *mrdb)
if (i == 0 && feof(stdin)) {
clearerr(stdin);
strcpy(mrdb->command, "quit");
i += strlen("quit");
i += sizeof("quit") - 1;
}
if (i == MAX_COMMAND_LINE) {