]> git.notmuchmail.org Git - notmuch/commit
smtp-dummy: Prefer return rather than exit() in main.
authorCarl Worth <cworth@cworth.org>
Tue, 21 Jun 2011 21:54:10 +0000 (14:54 -0700)
committerCarl Worth <cworth@cworth.org>
Wed, 22 Jun 2011 13:38:33 +0000 (06:38 -0700)
commitb0ba84f9e71b0f117dc0bdf0b790c6e2341d3949
tree23e518cd1af6a199b16b9f4aac16c1133eb55658
parent41a094624a079f4a145aba37e8059f8774dfaec6
smtp-dummy: Prefer return rather than exit() in main.

The main() function should be written as just another function with a
return value. This allows for more reliable code reuse. Imagine that
main() grows too large and needs to be factored into multiple
functions. At that point, exit() is probably the wrong thing, yet can
also be hard to notice as it's in less-frequently-tested exceptional
cases.
test/smtp-dummy.c