diff --git a/libclamav/htmlnorm.c b/libclamav/htmlnorm.c
index 1b04b5e37..0fb969404 100644
--- a/libclamav/htmlnorm.c
+++ b/libclamav/htmlnorm.c
@@ -618,7 +618,7 @@ static void screnc_decode(unsigned char *ptr, struct screnc_state *s)
remaining = strlen((const char*)ptr) + 1;
memmove(dst, ptr, remaining);
} else {
- *dst = '\0';
+ *ptr = '\0';
}
}