const unsigned char *c;
int length;
- if (!file) {
+ if (!file)
return NULL;
- }
length = 3 * strlen(file) + 9;
((c) >= 32 && (c) < 128 && (ACCEPTABLE_URI_CHARS[(c) - 32] & 0x08))
uri = alloca(length);
- if (uri == NULL) {
+ if (uri == NULL)
return NULL;
- }
strncpy(uri, "file://", length);
uri[length - 1] = '\0';
*t = '\0';
#undef _check_uri_char
- MD5Init(&ctx);
- MD5Update(&ctx, (unsigned char const *)uri, (unsigned)strlen(uri));
- MD5Final(hash, &ctx);
+ media_svc_MD5Init(&ctx);
+ media_svc_MD5Update(&ctx, (unsigned char const *)uri, (unsigned)strlen(uri));
+ media_svc_MD5Final(hash, &ctx);
for (n = 0; n < MD5_HASHBYTES; n++) {
md5out[2 * n] = hex[hash[n] >> 4];
{
char *hash = NULL;
- if (max_length < ((2 * MD5_HASHBYTES) + 1)) {
+ if (max_length < ((2 * MD5_HASHBYTES) + 1))
return MS_MEDIA_ERR_INVALID_PARAMETER;
- }
hash = _mb_svc_generate_hash_name(origin_path);
- if (hash == NULL) {
+ if (hash == NULL)
return MS_MEDIA_ERR_INTERNAL;
- }
strncpy(hash_code, hash, max_length);
hash_code[strlen(hash_code)] = '\0';