Partially reverting e4a4efdb42 to keep MSVS compatibility.
MSVS compatibility update.
fix bug in thread_reportin (watchdog can detect getwork is false before thr->last is set), and a few cosmetic changes
make sure reinit_device cannot happen while algo switching, which would probably result in segfault
Bugfix: initiate_stratum: Ensure extranonce2 size is not negative (which could lead to exploits later as too little memory gets allocated)

Thanks to Mick Ayzenberg <mick@dejavusecurity.com> for finding this!
Stratum: extract_sockaddr: Truncate overlong addresses rather than stack overflow

Thanks to Mick Ayzenberg <mick@dejavusecurity.com> for finding this!
stratum: parse_reconnect(): treat pool-sent URL as untrusted.

Thanks to Mick Ayzenberg <mick@dejavusecurity.com> for reminding
that this existed and highlighting the offender.

Also to Luke-jr for actually fixing this in bfgminer. :D
misc: update AUTHORS.md, add CR to sgminer.c, minor style.
stratum: parse_notify(): Don't die on malformed bbversion/prev_hash/nbit/ntime.

Might have introduced a memory leak, don't have time to check. :(

Should the other hex2bin()'s be checked?

Thanks to Mick Ayzenberg <mick.dejavusecurity.com> for finding this.
Merge branch 'dejavusec' into v5_0

Fixes for a few security vulnerabilities reported by Mick Ayzenberg
of DejaVu Security.
fix segfault (watchdog thread declares threads sick and tries to restart them while they are already being restarted)
Added null-termination for kernel build log.
Fixed MSVS build.
Merge branch 'v5_0' of https://github.com/sgminer-dev/sgminer into v5_0
Total uptime drop fix
Merge pull request #231 from tupieurods/feature

Total uptime drop fix
Fixed kernel path bug introduced in 8198286597
fix "diff 0.000/0.000"
Merge pull request #236 from Blagodarenko/v5_0

fix "diff 0.000/0.000"
fix compile without ADL