[Users] [Bug 4038] New: Make enum RecvProtocol (prefs_account.h) extensible

noreply at thewildbeast.co.uk noreply at thewildbeast.co.uk
Wed Jun 13 09:40:32 CEST 2018


https://www.thewildbeast.co.uk/claws-mail/bugzilla/show_bug.cgi?id=4038

            Bug ID: 4038
           Summary: Make enum RecvProtocol (prefs_account.h) extensible
    Classification: Unclassified
           Product: Claws Mail
           Version: GIT
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P3
         Component: Other
          Assignee: users at lists.claws-mail.org
          Reporter: rootkea at gmail.com

Hello!

Regarding wizard.c (Line 170):

{"recvtype", A_POP3, &tmpl.recvtype, P_INT, NULL, NULL, NULL},

Above code works just because A_POP3 is the first element of an 0-based enum.
If any change is made to enum RecvProtocol which makes A_POP3 != 0 then that's
a recipe for SegFault.

Honestly, current arrangement isn't quite ideal for extending the receive
protocols.

Possible solutions:
1. use a static array of enum values ("0", "1", "2") or
2. simply use "0" instead of A_POP3 with a comment

Above 2 approaches will be still tied to enum RecvProtocol and thus will
require an update if the enum RecvProtocol is changed. But at least there wont
be any SegFault.

-- 
You are receiving this mail because:
You are the assignee for the bug.



More information about the Users mailing list