The only place where this variable is used is in quarkcoin_test() function, which is not used at all in sgminer code, so I'm afraid this is not the cause. Thanks for suggestion anyway, I will investigate the issue when I have some free time.
if you can fix the miner on the algorithm quark'll be happy to donate for your work