Revert "add xargvlen"

This reverts commit e9468b25e1.
This commit is contained in:
Wirtos_new 2021-06-19 18:11:58 +03:00
parent 9f206af083
commit 8ffdbe8046
2 changed files with 0 additions and 16 deletions

View file

@ -10,18 +10,6 @@
# include <tchar.h>
#endif
size_t
xargvlen(const char *const *argv, size_t *n_args) {
size_t i, len = 0;
for (i = 0; argv[i]; i++) {
len += strlen(argv[i]);
if(i != 0) len += 1; /* extra for space */
}
if (n_args) *n_args = i;
return len;
}
size_t
xstrncpy(char *dest, const char *src, size_t n) {
size_t i;

View file

@ -6,10 +6,6 @@
#include <stdbool.h>
#include <stddef.h>
// returns the flat buffer size large enough to store all argv elements (excluding nul terminator) plus separating spaces
size_t
xargvlen(const char * const argv[], size_t *n_args);
// like strncpy, except:
// - it copies at most n-1 chars
// - the dest string is nul-terminated