|
@@ -281,8 +281,7 @@ static void parse_options(struct ts *ts, int argc, char **argv) {
|
281
|
281
|
char *p = NULL;
|
282
|
282
|
switch (j) {
|
283
|
283
|
case 'i':
|
284
|
|
- strncpy(ts->ident, optarg, sizeof(ts->ident) - 1);
|
285
|
|
- ts->ident[sizeof(ts->ident) - 1] = 0;
|
|
284
|
+ ts->ident = optarg;
|
286
|
285
|
break;
|
287
|
286
|
case 'd':
|
288
|
287
|
ts->pidfile = optarg;
|
|
@@ -473,7 +472,7 @@ static void parse_options(struct ts *ts, int argc, char **argv) {
|
473
|
472
|
exit(EXIT_SUCCESS);
|
474
|
473
|
}
|
475
|
474
|
}
|
476
|
|
- if (!ts->ident[0]) {
|
|
475
|
+ if (!ts->ident) {
|
477
|
476
|
if (ts->syslog_active || ts->notify_program)
|
478
|
477
|
ident_err = 1;
|
479
|
478
|
}
|
|
@@ -502,7 +501,8 @@ static void parse_options(struct ts *ts, int argc, char **argv) {
|
502
|
501
|
exit(EXIT_FAILURE);
|
503
|
502
|
}
|
504
|
503
|
|
505
|
|
- ts_LOGf("Ident : %s\n", ts->ident[0] ? ts->ident : "*NOT SET*");
|
|
504
|
+ if (ts->ident)
|
|
505
|
+ ts_LOGf("Ident : %s\n", ts->ident);
|
506
|
506
|
if (ts->notify_program)
|
507
|
507
|
ts_LOGf("Notify prg : %s\n", ts->notify_program);
|
508
|
508
|
if (ts->pidfile)
|
|
@@ -613,11 +613,12 @@ static void parse_options(struct ts *ts, int argc, char **argv) {
|
613
|
613
|
if (!ts->ecm_cw_log)
|
614
|
614
|
ts_LOGf("ECM/CW log : disabled\n");
|
615
|
615
|
|
616
|
|
- for (i=0; i<(int)sizeof(ts->ident); i++) {
|
617
|
|
- if (!ts->ident[i])
|
618
|
|
- break;
|
619
|
|
- if (ts->ident[i] == '/')
|
620
|
|
- ts->ident[i] = '-';
|
|
616
|
+ if (ts->ident) {
|
|
617
|
+ int len = strlen(ts->ident);
|
|
618
|
+ for (i = 0; i < len; i++) {
|
|
619
|
+ if (ts->ident[i] == '/')
|
|
620
|
+ ts->ident[i] = '-';
|
|
621
|
+ }
|
621
|
622
|
}
|
622
|
623
|
}
|
623
|
624
|
|