-
Notifications
You must be signed in to change notification settings - Fork 274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
第5章的strcmp实现有点小问题&修改建议 #10
Comments
有没有测试的case呢?具体传入什么字符串会导致返回0呢? |
如果两个字符串的长度和字符都相等才会返回0。比如字符串
|
嗯, 是的,这个函数是有问题的。多谢指出问题,已经修复并提交。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
源代码
libs/string.c
中实现strcmp
函数时的源代码是:这样如果两个字符串长度相等但字符串不同时,检测出来的结果就不对,大神应该当时没有注意到,算是一个小瑕疵吧。修正代码:
同时感谢大神的文档,比看《Orange's 一个操作系统的实现》要简易很多。
The text was updated successfully, but these errors were encountered: