Alan Ianson wrote to Andrew Alt <=-
Andrew Alt wrote to All <=-
Was wondering if anyone could give me some additional feedback on this small patch I submitted for MultiMail?
https://github.com/wmcbrine/MultiMail/pull/20
That shows the feedback I got so far, clicking the "files changed" tab shows the actual patch.
What's the patch do? I'll have look soonish.. :)
Not much of anything really xD It's pretty trivial.. but thought it was worth doing. I narrowed the scope of newtag and put the fopen statement next to the declaration of the file descriptor, and made a slight change to the condition (which probably could just be "flag = (fd);" but the PR was closed so... guess I
won't make any more changes to it...
-+-
interfac/tagline.cc | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/interfac/tagline.cc b/interfac/tagline.cc index 3020655..a7e836d 100644
-+- a/interfac/tagline.cc
+++ b/interfac/tagline.cc
@@ -259,13 +259,11 @@ void TaglineWindow::kill()
bool TaglineWindow::ReadFile()
{
FILE *fd;
- char newtag[TAGLINE_LENGTH + 1];
- bool flag;
-
fd = fopen(tagname, "rt");
- flag = !(!fd);
+ bool flag = (fd != NULL);
if (flag) {
+ char newtag[TAGLINE_LENGTH + 1];
char *end;
curr = &head;
--
-Andy
... DalekDOS v(overflow): (I)Obey (V)ision impaired (E)xterminate
-+- MultiMail/Linux v0.52
--- BBBS/Li6 v4.10 Toy-4
* Origin: Prism bbs (1:261/38)