From: Victor Julien Date: Sat, 7 Nov 2015 18:28:25 +0000 (+0100) Subject: device: constify string args X-Git-Tag: suricata-3.0RC2~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7b45a8a2a9cad49331654ee450e2c51b0cc26537;p=thirdparty%2Fsuricata.git device: constify string args --- diff --git a/src/util-device.c b/src/util-device.c index c08e30f0b8..fb2c04f649 100644 --- a/src/util-device.c +++ b/src/util-device.c @@ -42,7 +42,7 @@ static int live_devices_stats = 1; * \retval 0 on success. * \retval -1 on failure. */ -int LiveRegisterDevice(char *dev) +int LiveRegisterDevice(const char *dev) { LiveDevice *pd = SCMalloc(sizeof(LiveDevice)); if (unlikely(pd == NULL)) { @@ -113,7 +113,7 @@ char *LiveGetDeviceName(int number) * \retval ptr pointer to the string containing the device * \retval NULL on error */ -LiveDevice *LiveGetDevice(char *name) +LiveDevice *LiveGetDevice(const char *name) { int i = 0; LiveDevice *pd; @@ -136,12 +136,12 @@ LiveDevice *LiveGetDevice(char *name) -int LiveBuildDeviceList(char * runmode) +int LiveBuildDeviceList(const char *runmode) { return LiveBuildDeviceListCustom(runmode, "interface"); } -int LiveBuildDeviceListCustom(char * runmode, char * itemname) +int LiveBuildDeviceListCustom(const char *runmode, const char *itemname) { ConfNode *base = ConfGetNode(runmode); ConfNode *child; diff --git a/src/util-device.h b/src/util-device.h index fd6a821313..1fabdbe596 100644 --- a/src/util-device.h +++ b/src/util-device.h @@ -32,14 +32,14 @@ typedef struct LiveDevice_ { } LiveDevice; -int LiveRegisterDevice(char *dev); +int LiveRegisterDevice(const char *dev); int LiveGetDeviceCount(void); char *LiveGetDeviceName(int number); -LiveDevice *LiveGetDevice(char *dev); -int LiveBuildDeviceList(char * base); +LiveDevice *LiveGetDevice(const char *dev); +int LiveBuildDeviceList(const char *base); void LiveDeviceHasNoStats(void); int LiveDeviceListClean(void); -int LiveBuildDeviceListCustom(char * base, char * itemname); +int LiveBuildDeviceListCustom(const char *base, const char *itemname); #ifdef BUILD_UNIX_SOCKET TmEcode LiveDeviceIfaceStat(json_t *cmd, json_t *server_msg, void *data);