Minor bug fix in mmssend.c -- using variable 'settings' before it is initialised
This commit is contained in:
parent
8ef3978cab
commit
27d9e7f6ec
|
@ -22,11 +22,7 @@
|
|||
static Octstr *from;
|
||||
static List *to;
|
||||
static Octstr *data;
|
||||
static MmsMsg *m;
|
||||
static int savetommbox;
|
||||
Octstr *mmbox;
|
||||
|
||||
static MmscSettings *settings;
|
||||
|
||||
static int find_own(int i, int argc, char *argv[])
|
||||
{
|
||||
|
@ -34,8 +30,6 @@ static int find_own(int i, int argc, char *argv[])
|
|||
if (argv[i][1] == 'f')
|
||||
if (i + 1 < argc) {
|
||||
from = octstr_create(argv[i+1]);
|
||||
_mms_fixup_address(from,
|
||||
settings->unified_prefix ? octstr_get_cstr(settings->unified_prefix) : NULL);
|
||||
return 1;
|
||||
} else
|
||||
return -1;
|
||||
|
@ -43,18 +37,11 @@ static int find_own(int i, int argc, char *argv[])
|
|||
savetommbox = 1;
|
||||
return 0;
|
||||
} else if (argv[i][1] == 't')
|
||||
if (i + 1 < argc) {
|
||||
int j, m;
|
||||
List *l = octstr_split(octstr_create(argv[i+1]),
|
||||
octstr_imm(":"));
|
||||
for (j = 0, m = gwlist_len(l); j < m; j++) {
|
||||
Octstr *x = gwlist_get(l, j);
|
||||
_mms_fixup_address(x,
|
||||
settings->unified_prefix ? octstr_get_cstr(settings->unified_prefix) : NULL);
|
||||
gwlist_append(to, x);
|
||||
}
|
||||
gwlist_destroy(l, NULL);
|
||||
return 1;
|
||||
if (i + 1 < argc) {
|
||||
Octstr *x = octstr_create(argv[i+1]);
|
||||
to = octstr_split(x, octstr_imm(":"));
|
||||
octstr_destroy(x);
|
||||
return 1;
|
||||
} else
|
||||
return -1;
|
||||
else if (argv[i][1] == 'm')
|
||||
|
@ -63,14 +50,15 @@ static int find_own(int i, int argc, char *argv[])
|
|||
return 1;
|
||||
} else
|
||||
return -1;
|
||||
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
|
||||
static mCfg *cfg;
|
||||
|
||||
static MmscSettings *settings;
|
||||
static List *proxyrelays;
|
||||
static MmsMsg *m;
|
||||
Octstr *mmbox;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
|
@ -85,9 +73,7 @@ int main(int argc, char *argv[])
|
|||
return -1;
|
||||
|
||||
mms_lib_init();
|
||||
to = gwlist_create();
|
||||
srandom(time(NULL));
|
||||
|
||||
|
||||
cfidx = get_and_set_debugs(argc, argv, find_own);
|
||||
|
||||
if (argv[cfidx] == NULL)
|
||||
|
@ -118,8 +104,23 @@ int main(int argc, char *argv[])
|
|||
to == NULL) {
|
||||
error(0, "Sender and recipient addresses required!\n");
|
||||
exit(-1);
|
||||
} else { /* fix up 'to' list */
|
||||
List *l = gwlist_create();
|
||||
Octstr *x;
|
||||
while ((x = gwlist_extract_first(to)) != NULL) {
|
||||
octstr_strip_blanks(x);
|
||||
_mms_fixup_address(x,
|
||||
settings->unified_prefix ? octstr_get_cstr(settings->unified_prefix) : NULL);
|
||||
gwlist_append(l, x);
|
||||
}
|
||||
gwlist_destroy(to, NULL);
|
||||
to = l;
|
||||
}
|
||||
|
||||
/* fix from address. */
|
||||
_mms_fixup_address(from,
|
||||
settings->unified_prefix ? octstr_get_cstr(settings->unified_prefix) : NULL);
|
||||
|
||||
#if 0
|
||||
mms_start_profile_engine(octstr_get_cstr(settings->ua_profile_cache_dir));
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue