From 3fab33391cf284e2d4c9f7c0f833bb5c3aa0ffcf Mon Sep 17 00:00:00 2001 From: Pierre-Alexandre Meyer Date: Sat, 14 Mar 2009 15:58:36 -0700 Subject: [PATCH] hdt: find_argument should return a const char* Impact: Fix compilation warning, signature change. Handle command line arguments as const. This fixes a compilation warning. Signed-off-by: Pierre-Alexandre Meyer --- com32/hdt/hdt-common.c | 4 ++-- com32/hdt/hdt-common.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/com32/hdt/hdt-common.c b/com32/hdt/hdt-common.c index 1516c00..b626968 100644 --- a/com32/hdt/hdt-common.c +++ b/com32/hdt/hdt-common.c @@ -371,11 +371,11 @@ void cpu_detect(struct s_hardware *hardware) * Find the last instance of a particular command line argument * (which should include the final =; do not use for boolean arguments) */ -char *find_argument(const char **argv, const char *argument) +const char *find_argument(const char **argv, const char *argument) { int la = strlen(argument); const char **arg; - char *ptr = NULL; + const char *ptr = NULL; for (arg = argv; *arg; arg++) { if (!memcmp(*arg, argument, la)) diff --git a/com32/hdt/hdt-common.h b/com32/hdt/hdt-common.h index 9293ec0..8bec501 100644 --- a/com32/hdt/hdt-common.h +++ b/com32/hdt/hdt-common.h @@ -120,7 +120,7 @@ struct s_hardware { char pciids_path[255]; }; -char *find_argument(const char **argv, const char *argument); +const char *find_argument(const char **argv, const char *argument); int detect_dmi(struct s_hardware *hardware); void detect_disks(struct s_hardware *hardware); void detect_pci(struct s_hardware *hardware); -- 2.7.4