diff options
| author | Yabin Cui <yabinc@google.com> | 2015-02-17 19:27:51 -0800 |
|---|---|---|
| committer | Yabin Cui <yabinc@google.com> | 2015-02-17 19:27:51 -0800 |
| commit | e4c29eb960c75b30f476517d90b1ab1d05054301 (patch) | |
| tree | d4b36bc9bcc5df83d82f657a9343bfb913dfc06c /init/builtins.cpp | |
| parent | 3695751eedcedb62a8c763f4f5b2c7bbebfe1255 (diff) | |
Move sprintf to snprintf.
Bug: 19340053
Change-Id: Id0d866e6195ed4752b4be6081eeb2aab8b1dbe9a
Diffstat (limited to 'init/builtins.cpp')
| -rw-r--r-- | init/builtins.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/init/builtins.cpp b/init/builtins.cpp index 42cfa437da..9f3dcc1c69 100644 --- a/init/builtins.cpp +++ b/init/builtins.cpp @@ -389,7 +389,7 @@ int do_mount(int nargs, char **args) 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 @@ int do_mount(int nargs, char **args) } 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); |
