summaryrefslogtreecommitdiff
path: root/src/console/dlt-receive.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/console/dlt-receive.c')
-rw-r--r--src/console/dlt-receive.c25
1 files changed, 8 insertions, 17 deletions
diff --git a/src/console/dlt-receive.c b/src/console/dlt-receive.c
index 9cfad36..aef92b9 100644
--- a/src/console/dlt-receive.c
+++ b/src/console/dlt-receive.c
@@ -188,13 +188,10 @@ int64_t convert_arg_to_byte_size(char *arg)
min_size += 2048 /* DLT_USER_BUF_MAX_SIZE */;
if (min_size > result) {
- char tmp[256];
- snprintf(tmp,
- 256,
+ dlt_vlog(LOG_ERR,
"ERROR: Specified limit: %" PRId64 "is smaller than a the size of a single message: %" PRId64 "!\n",
result,
min_size);
- dlt_log(LOG_ERR, tmp);
result = -2;
}
@@ -212,9 +209,7 @@ int dlt_receive_open_output_file(DltReceiveData *dltdata)
if (glob(dltdata->ovalue, GLOB_TILDE | GLOB_NOSORT, NULL, &outer) == 0) {
if (dltdata->vflag) {
- char tmp[256];
- snprintf(tmp, 256, "File %s already exists, need to rename first\n", dltdata->ovalue);
- dlt_log(LOG_INFO, tmp);
+ dlt_vlog(LOG_INFO, "File %s already exists, need to rename first\n", dltdata->ovalue);
}
if (dltdata->part_num < 0) {
@@ -257,15 +252,12 @@ int dlt_receive_open_output_file(DltReceiveData *dltdata)
snprintf(filename, PATH_MAX, "%s.%i.dlt", dltdata->ovaluebase, dltdata->part_num++);
if (rename(dltdata->ovalue, filename) != 0) {
- char tmp[256];
- snprintf(tmp, 256, "ERROR: rename %s to %s failed with error %s\n", dltdata->ovalue, filename,
- strerror(errno));
- dlt_log(LOG_ERR, tmp);
+ dlt_vlog(LOG_ERR, "ERROR: rename %s to %s failed with error %s\n",
+ dltdata->ovalue, filename, strerror(errno));
}
else if (dltdata->vflag) {
- char tmp[256];
- snprintf(tmp, 256, "Renaming existing file from %s to %s\n", dltdata->ovalue, filename);
- dlt_log(LOG_INFO, tmp);
+ dlt_vlog(LOG_INFO, "Renaming existing file from %s to %s\n",
+ dltdata->ovalue, filename);
}
} /* if (file_already_exists) */
@@ -483,9 +475,8 @@ int main(int argc, char *argv[])
/* open DLT output file */
if (dltdata.ovalue) {
if (dltdata.climit > -1) {
- char tmp[256];
- snprintf(tmp, 256, "Using file size limit of %" PRId64 "bytes\n", dltdata.climit);
- dlt_log(LOG_INFO, tmp);
+ dlt_vlog(LOG_INFO, "Using file size limit of %" PRId64 "bytes\n",
+ dltdata.climit);
dltdata.ohandle = dlt_receive_open_output_file(&dltdata);
}
else { /* in case no limit for the output file is given, we simply overwrite any existing file */