Lines Matching refs:len
31 size_t len = (ret >= size) ? size - 1 : ret; in strlcpy() local
32 memcpy(dest, src, len); in strlcpy()
33 dest[len] = '\0'; in strlcpy()
61 size_t len; in perf_vsnpath() local
63 len = strlen(perf_dir); in perf_vsnpath()
64 if (n < len + 1) in perf_vsnpath()
66 memcpy(buf, perf_dir, len); in perf_vsnpath()
67 if (len && !is_dir_sep(perf_dir[len-1])) in perf_vsnpath()
68 buf[len++] = '/'; in perf_vsnpath()
69 len += vsnprintf(buf + len, n - len, fmt, args); in perf_vsnpath()
70 if (len >= n) in perf_vsnpath()
91 unsigned len; in mkpath() local
95 len = vsnprintf(pathname, PATH_MAX, fmt, args); in mkpath()
97 if (len >= PATH_MAX) in mkpath()
107 unsigned len; in perf_path() local
109 len = strlen(perf_dir); in perf_path()
110 if (len > PATH_MAX-100) in perf_path()
112 memcpy(pathname, perf_dir, len); in perf_path()
113 if (len && perf_dir[len-1] != '/') in perf_path()
114 pathname[len++] = '/'; in perf_path()
116 len += vsnprintf(pathname + len, PATH_MAX - len, fmt, args); in perf_path()
118 if (len >= PATH_MAX) in perf_path()
124 static inline int chomp_trailing_dir_sep(const char *path, int len) in chomp_trailing_dir_sep() argument
126 while (len && is_dir_sep(path[len - 1])) in chomp_trailing_dir_sep()
127 len--; in chomp_trailing_dir_sep()
128 return len; in chomp_trailing_dir_sep()