From 279d26af87c48735fa6cbf2b5ef81522ad72b17a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Thu, 27 May 2010 11:58:18 +0000 Subject: [PATCH] * Fixed stupid usage of strlen() in two cases. * Fixed 80-character column limit. * Updated copyright that Ingo forgot with his previous commit. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36948 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/bin/xres.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/bin/xres.cpp b/src/bin/xres.cpp index b5f23c4079..9eca1f3d00 100644 --- a/src/bin/xres.cpp +++ b/src/bin/xres.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2005-2009, Ingo Weinhold, bonefish@users.sf.net. + * Copyright 2005-2010, Ingo Weinhold, bonefish@users.sf.net. * Distributed under the terms of the MIT License. */ @@ -364,8 +364,9 @@ struct ListState : State { size_t size; for (int32 i = 0; resources.GetResourceInfo(i, &type, &id, &name, &size); i++) { - printf("'%s' %11" B_PRId32 " %11" B_PRIuSIZE " %s\n", resource_type(type), id, - size, (name && strlen(name) > 0 ? name : "(no name)")); + printf("'%s' %11" B_PRId32 " %11" B_PRIuSIZE " %s\n", + resource_type(type), id, size, + name != NULL && name[0] != '\0' ? name : "(no name)"); } } }; @@ -661,7 +662,7 @@ print_usage(bool error) commandName = kArgv[0]; } - if (!commandName || strlen(commandName) == 0) + if (!commandName || commandName[0] == '\0') commandName = kCommandName; // print usage