summaryrefslogtreecommitdiffstats
path: root/src/nolo.c
diff options
context:
space:
mode:
authorPali Rohár <pali.rohar@gmail.com>2014-10-19 20:23:21 +0200
committerPali Rohár <pali.rohar@gmail.com>2014-10-19 20:23:21 +0200
commitf0712d5b23073fcb7d73085132ef72748fa31ae8 (patch)
tree72a59e871377ba5694e47d7920005b1011959ad4 /src/nolo.c
parent8d52950ede71561d1f266833f06e747b7d6e0768 (diff)
download0xFFFF-f0712d5b23073fcb7d73085132ef72748fa31ae8.tar.bz2
all: Replace strlen() call on const string with sizeof()-1
Diffstat (limited to 'src/nolo.c')
-rw-r--r--src/nolo.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nolo.c b/src/nolo.c
index 9ba5a06..77d49e9 100644
--- a/src/nolo.c
+++ b/src/nolo.c
@@ -464,7 +464,7 @@ int nolo_flash_image(struct usb_device_info * dev, struct image * image) {
if ( nolo_get_string(dev, "cmt:status", buf, sizeof(buf)) < 0 )
NOLO_ERROR_RETURN("cmt:status failed", -1);
- if ( strncmp(buf, "idle", strlen("idle")) == 0 )
+ if ( strncmp(buf, "idle", sizeof("idle")-1) == 0 )
state = 4;
else
printf("Erasing CMT...\n");
@@ -476,7 +476,7 @@ int nolo_flash_image(struct usb_device_info * dev, struct image * image) {
NOLO_ERROR_RETURN("cmt:status failed", -1);
}
- if ( strncmp(buf, "finished", strlen("finished")) == 0 ) {
+ if ( strncmp(buf, "finished", sizeof("finished")-1) == 0 ) {
if ( state <= 0 ) {
printf_progressbar(last_total, last_total);
@@ -537,9 +537,9 @@ int nolo_boot_device(struct usb_device_info * dev, const char * cmdline) {
int size = 0;
int mode = NOLO_BOOT_MODE_NORMAL;
- if ( cmdline && strncmp(cmdline, "update", strlen("update")) == 0 && cmdline[strlen("update")] <= 32 ) {
+ if ( cmdline && strncmp(cmdline, "update", sizeof("update")-1) == 0 && cmdline[sizeof("update")-1] <= 32 ) {
mode = NOLO_BOOT_MODE_UPDATE;
- cmdline += strlen("update");
+ cmdline += sizeof("update")-1;
if ( *cmdline ) ++cmdline;
while ( *cmdline && *cmdline <= 32 )
++cmdline;