mirror of
https://github.com/team-infusion-developers/android_hardware_samsung.git
synced 2024-11-06 21:55:41 +00:00
power: sysfs_read: Do not store newlines
Change-Id: If20b509b489b056ac3b37c208c42bc5407f61802
This commit is contained in:
parent
f6e983c722
commit
0da5fbf3e2
1 changed files with 6 additions and 1 deletions
|
@ -99,7 +99,12 @@ static int sysfs_read(char *path, char *s, int num_bytes)
|
|||
|
||||
ret = -1;
|
||||
} else {
|
||||
s[len] = '\0';
|
||||
// do not store newlines, but terminate the string instead
|
||||
if (s[len-1] == '\n') {
|
||||
s[len-1] = '\0';
|
||||
} else {
|
||||
s[len] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
close(fd);
|
||||
|
|
Loading…
Reference in a new issue