MCPcopy Create free account
hub / github.com/aldostools/webMAN-MOD / ssplit

Function ssplit

include/ftp.h:109–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107}
108
109static int ssplit(const char *str, char *left, u16 lmaxlen, char *right, u16 rmaxlen)
110{
111 u16 lsize, rsize;
112 char *sep = strchr(str, ' ');
113
114 if(sep)
115 {
116 lsize = MIN(sep - str, lmaxlen);
117 rsize = MIN(strlen(sep + 1), rmaxlen);
118 memcpy64(right, sep + 1, rsize);
119 }
120 else
121 {
122 lsize = lmaxlen;
123 rsize = 0;
124 }
125
126 memcpy64(left, str, lsize);
127 left[lsize] = '\0';
128 right[rsize] = '\0';
129
130 return (sep != NULL);
131}
132
133// Returns length of a number in digits
134static int str_num_length(const char *ptr, int max_digits)

Callers 3

handleclient_ftpFunction · 0.85
www_client.hFile · 0.85
handleclient_ps3mapiFunction · 0.85

Calls 3

strchrFunction · 0.50
strlenFunction · 0.50
memcpy64Function · 0.50

Tested by

no test coverage detected