Skip to content

Commit

Permalink
Merge pull request #43 from tezc/string-perf
Browse files Browse the repository at this point in the history
Minor string trim fix, minor doc change
  • Loading branch information
tezc authored Feb 14, 2021
2 parents dbfc704 + e858b89 commit ed5bcab
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ There is no build, copy .h .c files you want.

Libraries are portable, see [test](#test) section for details.

As a general rule, all libraries report errors back to users (e.g out of memory).
If a library uses heap memory, you can plug your allocator.
As a general rule, all libraries report errors back to users (e.g out of memory).

### List

Expand All @@ -29,7 +28,7 @@ If a library uses heap memory, you can plug your allocator.
| **[perf](perf)** | Benchmark utility to get performance counters info via perf_event_open() |
| **[queue](queue)** | Generic queue which can be used as dequeue/stack/list as well |
| **[sc](sc)** | Utility functions |
| **[signal](signal)** | Signal handler & signal safe snprintf (handling CTRL+C, printing backtrace on crash etc) |
| **[signal](signal)** | Signal safe snprintf & Signal handler (handling CTRL+C, printing backtrace on crash etc) |
| **[socket](socket)** | Pipe / tcp sockets(also unix domain sockets) /Epoll/Kqueue/WSAPoll for Posix and Windows |
| **[string](string)** | Length prefixed, null terminated C strings. |
| **[thread](thread)** | Thread wrapper for Posix and Windows. |
Expand Down
2 changes: 1 addition & 1 deletion string/sc_str.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ bool sc_str_trim(char **str, const char *list)
return true;
}

len = strlen(*str);
len = sc_str_meta(*str)->len;
start = *str + strspn(*str, list);
end = (*str) + len;

Expand Down

0 comments on commit ed5bcab

Please sign in to comment.