cjlin1 / libsvm

LIBSVM -- A Library for Support Vector Machines
https://www.csie.ntu.edu.tw/~cjlin/libsvm/
BSD 3-Clause "New" or "Revised" License
4.54k stars 1.64k forks source link

Useless assignment found by static analyzer? #121

Open QiAnXinCodeSafe opened 6 years ago

QiAnXinCodeSafe commented 6 years ago

Hi all, This is Qihoo360 CodeSafe Team, we found a useless assignment in libsvm, see https://github.com/cjlin1/libsvm/blob/88a1881f03ca139beff93170d7e6f36477fabe54/svm.cpp#L2932. The return value of strtok(line, ":") assigned to p, and this value is never read!

This is not a fatal issue, and I can't provide a perfect fix for that!

Could you help me confirm this, @cjlin1!

Thanks in advance!

cjlin1 commented 6 years ago

Yes, for that assignment the returned value is not used. But I guess it's ok to leave that there.

360 CodeSafe writes:

Hi all, This is Qihoo360 CodeSafe Team, we found a useless assignment in libsvm, see https://github.com/cjlin1/libsvm/blob/88a1881f03ca139beff93170d7e6f36477fabe54/svm.cpp#L2932 . The return value of strtok(line, ":") assigned to p, and this value is never read!

This is not a fatal issue, and I can't provide a perfect fix for that!

Could you help me confirm this, @cjlin1!

Thanks in advance!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.*

QiAnXinCodeSafe commented 6 years ago

@cjlin1 Hmm, you are right, it is not an issue that worth the effort to fix for now.