mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-08-02 22:29:25 +00:00
parent
9f206af083
commit
8ffdbe8046
2 changed files with 0 additions and 16 deletions
|
@ -10,18 +10,6 @@
|
||||||
# include <tchar.h>
|
# include <tchar.h>
|
||||||
#endif
|
#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
|
size_t
|
||||||
xstrncpy(char *dest, const char *src, size_t n) {
|
xstrncpy(char *dest, const char *src, size_t n) {
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
|
@ -6,10 +6,6 @@
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stddef.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:
|
// like strncpy, except:
|
||||||
// - it copies at most n-1 chars
|
// - it copies at most n-1 chars
|
||||||
// - the dest string is nul-terminated
|
// - the dest string is nul-terminated
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue