Re: Code style with commit ffa31264a657618a0e40c51c01e4bfc32e244d13
"Joel Esler (jesler)" <[email protected]>
| Newsgroups | gmane.comp.security.virus.clamav.devel |
|---|---|
| Message-ID | <[email protected]> |
Shawn, Thanks for writing in, looks like we’ve already re-formatted this code for 99.3, which should be released soon. -- Joel Esler | Talos: Manager | [email protected] <mailto:[email protected]> > On Jul 20, 2017, at 2:36 PM, Shawn Webb <[email protected]> wrote: > > Hey ClamAV Developers, > > The part of the diff that reads: > > if ( !(len = sys->read(fh, &buf[0], 256) > 0)) { > > is a little awkward. I'm wondering if it would be better to be split > out. Something like this: > > len = sys->read(fh, buf, sizeof(buf)); > if (len <= 0) { > ... > } > > That would make the code a bit more readable for future developers. It > would also prevent issues in case the size of buf were to ever change in > the future. > > Thanks, > > -- > Shawn Webb > Cofounder and Security Engineer of HardenedBSD > > GPG Key ID: 0x6A84658F52456EEE > GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE > > _______________________________________________ > http://lurker.clamav.net/list/clamav-devel.html > Please submit your patches to our Bugzilla: http://bugs.clamav.net > > http://www.clamav.net/contact.html#ml _______________________________________________ http://lurker.clamav.net/list/clamav-devel.html Please submit your patches to our Bugzilla: http://bugs.clamav.net http://www.clamav.net/contact.html#ml
signature.asc
(application/pgp-signature, 163 B)
-----BEGIN PGP SIGNATURE----- iEYEARECAAYFAll/pRAACgkQXcGOvXe9qC7nTACgsaH2UxB/N5/Dd9N25wDfW6oa d38Ani1i0HReInEgXSoxQsXhUuhw3t1d =9lmM -----END PGP SIGNATURE-----