aboutsummaryrefslogtreecommitdiffhomepage
path: root/stream
diff options
context:
space:
mode:
authorGravatar rtogni <rtogni@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-04-09 21:26:49 +0000
committerGravatar rtogni <rtogni@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-04-09 21:26:49 +0000
commit2213c30ac23f1dd2dbb82eff917ec83538db6b6a (patch)
tree986a53f824d1e280a779d4f59e3dd7fc2257393d /stream
parent2b1e8246a9682545dfa90a9d393f87a330b49bd6 (diff)
Simplify calc_response_string()
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22961 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'stream')
-rw-r--r--stream/realrtsp/real.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/stream/realrtsp/real.c b/stream/realrtsp/real.c
index e834697e7a..b11b2a7faa 100644
--- a/stream/realrtsp/real.c
+++ b/stream/realrtsp/real.c
@@ -86,21 +86,14 @@ static void hexdump (const char *buf, int length) {
static void calc_response_string (char *result, char *challenge) {
- char zres[16];
+ unsigned char zres[16];
int i;
av_md5_sum(zres, challenge, 64);
/* convert zres to ascii string */
- for (i=0; i<16; i++ ) {
- char a, b;
-
- a = (zres[i] >> 4) & 15;
- b = zres[i] & 15;
-
- result[i*2] = ((a<10) ? (a+48) : (a+87)) & 255;
- result[i*2+1] = ((b<10) ? (b+48) : (b+87)) & 255;
- }
+ for (i=0; i<16; i++ )
+ sprintf(result+i*2, "%02x", zres[i]);
}
static void real_calc_response_and_checksum (char *response, char *chksum, char *challenge) {