mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-04-21 03:55:05 +00:00
parent
9f206af083
commit
8ffdbe8046
2 changed files with 0 additions and 16 deletions
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue