diff options
author | Denys Vlasenko <dvlasenk@redhat.com> | 2010-10-22 17:25:15 +0200 |
---|---|---|
committer | Denys Vlasenko <dvlasenk@redhat.com> | 2010-10-22 17:25:15 +0200 |
commit | ff3392b9c9471cd6d837a9ab3abe135ab2d75edf (patch) | |
tree | 65595bf77f2bacc9315f20e6718356193f61cfe4 /src/cli/report.cpp | |
parent | b74cfbee13b9d2723dd48fe3e2a049fc55129699 (diff) | |
download | abrt-ff3392b9c9471cd6d837a9ab3abe135ab2d75edf.tar.gz abrt-ff3392b9c9471cd6d837a9ab3abe135ab2d75edf.tar.xz abrt-ff3392b9c9471cd6d837a9ab3abe135ab2d75edf.zip |
introduce and use xmalloc_fgets/fgetline
This fixes problems of having long lines truncated - and we do have very long lines
sometimes - curl errors with HTML, list of debuginfos etc.
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'src/cli/report.cpp')
-rw-r--r-- | src/cli/report.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/cli/report.cpp b/src/cli/report.cpp index 46205f7e..b6edef9a 100644 --- a/src/cli/report.cpp +++ b/src/cli/report.cpp @@ -542,10 +542,9 @@ static bool ask_yesno(const char *question) /* The response might take more than 1 char in non-latin scripts. */ const char *yes = _("y"); const char *no = _("N"); - char *full_question = xasprintf("%s [%s/%s]: ", question, yes, no); - printf(full_question); - free(full_question); + printf("%s [%s/%s]: ", question, yes, no); fflush(NULL); + char answer[16]; fgets(answer, sizeof(answer), stdin); /* Use strncmp here because the answer might contain a newline as |