summaryrefslogtreecommitdiffstats
path: root/lib/Plugins/Firefox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Plugins/Firefox.cpp')
-rw-r--r--lib/Plugins/Firefox.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/Plugins/Firefox.cpp b/lib/Plugins/Firefox.cpp
index e8b12f5..98d892b 100644
--- a/lib/Plugins/Firefox.cpp
+++ b/lib/Plugins/Firefox.cpp
@@ -623,9 +623,7 @@ Another application is holding the yum lock, cannot continue
std::string packageName = package.substr(0, package.rfind("-", package.rfind("-")-1));
while (fgets(buff, sizeof(buff), pipeout_fp))
{
- int last = strlen(buff) - 1;
- if (last >= 0 && buff[last] == '\n')
- buff[last] = '\0';
+ strchrnul(buff, '\n')[0] = '\0';
log("%s", buff);
update_client("%s", buff); /* maybe only if buff != ""? */
@@ -712,9 +710,7 @@ static void InstallDebugInfos(const char *pDebugDumpDir, std::string& build_ids)
char buff[1024];
while (fgets(buff, sizeof(buff), pipeout_fp))
{
- int last = strlen(buff) - 1;
- if (last >= 0 && buff[last] == '\n')
- buff[last] = '\0';
+ strchrnul(buff, '\n')[0] = '\0';
if (strncmp(buff, "MISSING:", 8) == 0)
{