Root/
Source at commit 307 created 13 years 2 hours ago. By ifabio, merge changes from trunk (929). Also merge the module changes from Azimutz branche (fix compile error) Also edited the info.plist into AHCIPortInjector.kext: http://forum.voodooprojects.org/index.php/topic,1170.0.html | |
---|---|
1 | /*␊ |
2 | * strnlen()␊ |
3 | */␊ |
4 | ␊ |
5 | #include <string.h>␊ |
6 | ␊ |
7 | size_t strnlen(const char *s, size_t maxlen)␊ |
8 | {␊ |
9 | ␉const char *ss = s;␊ |
10 | ␊ |
11 | ␉/* Important: the maxlen test must precede the reference through ss;␊ |
12 | ␉ since the byte beyond the maximum may segfault */␊ |
13 | ␉while ((maxlen > 0) && *ss) {␊ |
14 | ␉␉ss++;␊ |
15 | ␉␉maxlen--;␊ |
16 | ␉}␊ |
17 | ␉return ss - s;␊ |
18 | }␊ |
19 |