File: 0001-Remove-duplicate-check-for-temp-i-0.patch

package info (click to toggle)
das-watchdog 0.9.0-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 252 kB
  • sloc: ansic: 3,280; sh: 60; makefile: 48
file content (25 lines) | stat: -rw-r--r-- 707 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
From b76e17f733bddb5295ef34eed4dd444b31c7b12f Mon Sep 17 00:00:00 2001
From: Adam Sampson <ats@offog.org>
Date: Wed, 1 Apr 2015 20:28:28 +0100
Subject: [PATCH 1/3] Remove duplicate check for temp[i] == '\0'

---
 das_watchdog.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/das_watchdog.c b/das_watchdog.c
index ab97753..176fb1b 100644
--- a/das_watchdog.c
+++ b/das_watchdog.c
@@ -330,7 +330,7 @@ static char *get_pid_environ_val(pid_t pid,char *val){
       
     temp[i]=fgetc(fp);    
 
-    if(foundit==1 && (temp[i]==0 || temp[i]=='\0' || temp[i]==EOF)){
+    if(foundit==1 && (temp[i]=='\0' || temp[i]==EOF)){
       fclose(fp);
       temp[i]=0;
       return temp;
-- 
2.1.4