| 221 | } |
| 222 | |
| 223 | static const FS_Path |
| 224 | archive_utf16path(struct _reent *r, |
| 225 | const char *path, |
| 226 | archive_fsdevice **device) |
| 227 | { |
| 228 | ssize_t units; |
| 229 | FS_Path fspath; |
| 230 | |
| 231 | fspath.data = NULL; |
| 232 | |
| 233 | if(archive_fixpath(r, path, device) == NULL) |
| 234 | return fspath; |
| 235 | |
| 236 | units = utf8_to_utf16(__ctru_dev_utf16_buf, (const uint8_t*)__ctru_dev_path_buf, PATH_MAX); |
| 237 | if(units < 0) |
| 238 | { |
| 239 | r->_errno = EILSEQ; |
| 240 | return fspath; |
| 241 | } |
| 242 | if(units > PATH_MAX) |
| 243 | { |
| 244 | r->_errno = ENAMETOOLONG; |
| 245 | return fspath; |
| 246 | } |
| 247 | |
| 248 | __ctru_dev_utf16_buf[units] = 0; |
| 249 | |
| 250 | fspath.type = PATH_UTF16; |
| 251 | fspath.size = (units+1)*sizeof(uint16_t); |
| 252 | fspath.data = __ctru_dev_utf16_buf; |
| 253 | |
| 254 | return fspath; |
| 255 | } |
| 256 | |
| 257 | extern int __system_argc; |
| 258 | extern char** __system_argv; |
no test coverage detected