forked from osmocom/wireshark
Rename a variable to avoid collisions with a global variable, as noted
by John Smith. svn path=/trunk/; revision=25548
This commit is contained in:
parent
256552f6a3
commit
6b762c78a5
6
util.c
6
util.c
|
@ -48,7 +48,7 @@
|
||||||
* separated by spaces.
|
* separated by spaces.
|
||||||
*/
|
*/
|
||||||
char *
|
char *
|
||||||
get_args_as_string(int argc, char **argv, int optind)
|
get_args_as_string(int argc, char **argv, int optindex)
|
||||||
{
|
{
|
||||||
int len;
|
int len;
|
||||||
int i;
|
int i;
|
||||||
|
@ -58,7 +58,7 @@ get_args_as_string(int argc, char **argv, int optind)
|
||||||
* Find out how long the string will be.
|
* Find out how long the string will be.
|
||||||
*/
|
*/
|
||||||
len = 0;
|
len = 0;
|
||||||
for (i = optind; i < argc; i++) {
|
for (i = optindex; i < argc; i++) {
|
||||||
len += strlen(argv[i]);
|
len += strlen(argv[i]);
|
||||||
len++; /* space, or '\0' if this is the last argument */
|
len++; /* space, or '\0' if this is the last argument */
|
||||||
}
|
}
|
||||||
|
@ -72,7 +72,7 @@ get_args_as_string(int argc, char **argv, int optind)
|
||||||
* Now construct the string.
|
* Now construct the string.
|
||||||
*/
|
*/
|
||||||
argstring[0] = '\0';
|
argstring[0] = '\0';
|
||||||
i = optind;
|
i = optindex;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
g_strlcat(argstring, argv[i], len);
|
g_strlcat(argstring, argv[i], len);
|
||||||
i++;
|
i++;
|
||||||
|
|
2
util.h
2
util.h
|
@ -32,7 +32,7 @@ extern "C" {
|
||||||
/* Collect command-line arguments as a string consisting of the arguments,
|
/* Collect command-line arguments as a string consisting of the arguments,
|
||||||
* separated by spaces.
|
* separated by spaces.
|
||||||
*/
|
*/
|
||||||
char *get_args_as_string(int argc, char **argv, int optind);
|
char *get_args_as_string(int argc, char **argv, int optindex);
|
||||||
|
|
||||||
/* Compute the difference between two seconds/microseconds time stamps.
|
/* Compute the difference between two seconds/microseconds time stamps.
|
||||||
* Beware: we're using nanosecond resolution now and function is currently unused
|
* Beware: we're using nanosecond resolution now and function is currently unused
|
||||||
|
|
Loading…
Reference in New Issue