The code is definitely cleaner with all your suggestions. I'm applying them now.
Mounir IDRASSI IDRIX - Cryptography and IT Security Experts http://www.idrix.fr
James wrote:
This would be a lot cleaner as:
if (!(liteSCardEstablishContext = (SCardEstablishContextPtr) wine_dlsym(g_pcscliteHandle,"SCardEstablishContext",szErr,sizeof(szErr))) { ERR("Failed to get SCardEstablishContext from pcsclite library. Error = %s\n",szErr); goto error; }
I think in C you can skip the cast from void *, can't you? e.g.
liteSCardEstablishContext = wine_dlsym(g_pcscliteHandle,"SCardEstablishContext",szErr,sizeof(szErr));