diff options
Diffstat (limited to 'tools/xenpmd/xenpmd.c')
-rw-r--r-- | tools/xenpmd/xenpmd.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/tools/xenpmd/xenpmd.c b/tools/xenpmd/xenpmd.c index c98e898316..28de744ef0 100644 --- a/tools/xenpmd/xenpmd.c +++ b/tools/xenpmd/xenpmd.c @@ -297,7 +297,6 @@ int get_next_battery_info_or_status(DIR *battery_dir, if ( !info_or_status ) return 0; - memset(line_info, 0, 256); if (type == BIF) memset(info_or_status, 0, sizeof(struct battery_info)); else @@ -307,11 +306,8 @@ int get_next_battery_info_or_status(DIR *battery_dir, if ( !file ) return 0; - while ( fgets(line_info, 1024, file) != NULL ) - { + while ( fgets(line_info, sizeof(line_info), file) != NULL ) parse_battery_info_or_status(line_info, type, info_or_status); - memset(line_info, 0, 256); - } fclose(file); return 1; |