From 88572c4c08c8236e4759130dbb44771d4103de70 Mon Sep 17 00:00:00 2001 From: Fred Gleason Date: Tue, 1 Jun 2021 11:59:51 -0400 Subject: [PATCH] 2021-06-01 Fred Gleason * Cleaned up compile warnings in 'lib/rdformpost.cpp'. Signed-off-by: Fred Gleason --- .#ChangeLog | 1 - ChangeLog | 2 ++ lib/rdformpost.cpp | 11 +++++++---- 3 files changed, 9 insertions(+), 5 deletions(-) delete mode 120000 .#ChangeLog diff --git a/.#ChangeLog b/.#ChangeLog deleted file mode 120000 index 228eda67..00000000 --- a/.#ChangeLog +++ /dev/null @@ -1 +0,0 @@ -fredg@frozone.3298:1622508567 \ No newline at end of file diff --git a/ChangeLog b/ChangeLog index 13b59c45..be2e3179 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21774,3 +21774,5 @@ * Cleaned up compile warnings in 'lib/rddownload.cpp'. 2021-06-01 Fred Gleason * Cleaned up a compile warning in 'lib/rdevent_line.cpp'. +2021-06-01 Fred Gleason + * Cleaned up compile warnings in 'lib/rdformpost.cpp'. diff --git a/lib/rdformpost.cpp b/lib/rdformpost.cpp index 7274bb5e..002ebbe5 100644 --- a/lib/rdformpost.cpp +++ b/lib/rdformpost.cpp @@ -2,7 +2,7 @@ // // Handle data from an HTML form. // -// (C) Copyright 2009-2020 Fred Gleason +// (C) Copyright 2009-2021 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -97,7 +97,7 @@ RDFormPost::RDFormPost(RDFormPost::Encoding encoding,unsigned maxsize, // (Perhaps) autodetect the encoding type // char first[2]; - read(0,first,1); + RDCheckExitCode("RDFormPost::RDFormPost read",read(0,first,1)); if(post_encoding==RDFormPost::AutoEncoded) { if(first[0]=='-') { post_encoding=RDFormPost::MultipartEncoded; @@ -690,7 +690,8 @@ bool RDFormPost::GetMimePart(QString *name,QString *value,bool *is_file) data=GetLine(); line=QString::fromUtf8(data).trimmed(); while(!line.contains(post_separator)) { - write(fd,data,data.length()); + RDCheckExitCode("RDFormPost::GetMimePart write", + write(fd,data,data.length())); data=GetLine(); line=QString::fromUtf8(data).trimmed(); } @@ -705,7 +706,9 @@ bool RDFormPost::GetMimePart(QString *name,QString *value,bool *is_file) } if(fd>=0) { - ftruncate(fd,lseek(fd,0,SEEK_CUR)-2); // Remove extraneous final CR/LF + // Remove extraneous final CR/LF + RDCheckExitCode("RDFormPost::GetMimePart ftruncate", + ftruncate(fd,lseek(fd,0,SEEK_CUR)-2)); close(fd); }