| 83 | } |
| 84 | |
| 85 | int pbufFindStr(const pbuf* buf, const char* wtf, unsigned startPos) |
| 86 | { |
| 87 | if(wtf == nullptr) { |
| 88 | return -1; |
| 89 | } |
| 90 | |
| 91 | int cur = startPos; |
| 92 | while(true) { |
| 93 | cur = pbufFindChar(buf, wtf[0], cur); |
| 94 | if(cur < 0) { |
| 95 | return -1; |
| 96 | } |
| 97 | |
| 98 | if(pbufIsStrEqual(buf, wtf, cur)) { |
| 99 | return cur; |
| 100 | } |
| 101 | cur++; |
| 102 | } |
| 103 | |
| 104 | return -1; |
| 105 | } |
| 106 | |
| 107 | char* pbufAllocateStrCopy(const pbuf* buf, unsigned startPos, unsigned length) |
| 108 | { |
no test coverage detected