FreeBSD Bugzilla – Attachment 43065 Details for
Bug 66988
[patch] apm(8) check validation of the returned values
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
apm.diff
apm.diff (text/plain), 1.31 KB, created by
Liam Foy
on 2004-05-21 13:40:11 UTC
(
hide
)
Description:
apm.diff
Filename:
MIME Type:
Creator:
Liam Foy
Created:
2004-05-21 13:40:11 UTC
Size:
1.31 KB
patch
obsolete
>--- /usr/src/usr.sbin/apm/apm.c Thu May 20 20:30:57 2004 >+++ /hd2/apm.c Fri May 21 12:06:48 2004 >@@ -496,15 +496,33 @@ > if (all_info) > print_all_info(fd, &info, bioscall_available); > if (ac_status) >- printf("%d\n", info.ai_acline); >+ if(info.ai_acline == 255) >+ printf("unknown (255)\n"); >+ else if(info.ai_acline > 1) >+ printf("invalid value 0x%x (%d)\n", info.ai_acline, info.ai_acline); >+ else >+ printf("%d\n", info.ai_acline); > if (batt_status) >- printf("%d\n", info.ai_batt_stat); >+ if(info.ai_batt_stat == 255) >+ printf("unknown (255)\n"); >+ else if(info.ai_batt_stat > 3) >+ printf("invalid value 0x%x (%d)\n", info.ai_batt_stat, info.ai_batt_stat); >+ else >+ printf("%d\n", info.ai_batt_stat); > if (batt_life) >- printf("%d\n", info.ai_batt_life); >+ if(info.ai_batt_life == 255) >+ printf("unknown (255)\n"); >+ else if(info.ai_batt_life >= 0 && info.ai_batt_life <= 100) >+ printf("%d\n", info.ai_batt_life); >+ else >+ printf("invalid value 0x%x (%d)\n", info.ai_batt_life, info.ai_batt_life); > if (apm_status) > printf("%d\n", info.ai_status); > if (batt_time) >- printf("%d\n", info.ai_batt_time); >+ if(info.ai_batt_time == -1) >+ printf("unknown (-1)\n"); >+ else >+ printf("%d\n", info.ai_batt_time); > if (display != -1) > apm_display(fd, display); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 66988
: 43065