Move sprintf to snprintf.
Bug: 19340053
Change-Id: Id0d866e6195ed4752b4be6081eeb2aab8b1dbe9a
diff --git a/init/builtins.cpp b/init/builtins.cpp
index 42cfa43..9f3dcc1 100644
--- a/init/builtins.cpp
+++ b/init/builtins.cpp
@@ -389,7 +389,7 @@
return -1;
}
- sprintf(tmp, "/dev/block/mtdblock%d", n);
+ snprintf(tmp, sizeof(tmp), "/dev/block/mtdblock%d", n);
if (wait)
wait_for_file(tmp, COMMAND_RETRY_TIMEOUT);
@@ -409,7 +409,7 @@
}
for (n = 0; ; n++) {
- sprintf(tmp, "/dev/block/loop%d", n);
+ snprintf(tmp, sizeof(tmp), "/dev/block/loop%d", n);
loop = open(tmp, mode | O_CLOEXEC);
if (loop < 0) {
close(fd);