Fix conditions for including string.h in error.c

<string.h> is actually needed when MBEDTLS_ERROR_C is enabled and not
when only MBEDTLS_ERROR_STRERROR_DUMMY is enabled.

Fix #3866.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
diff --git a/ChangeLog.d/error-include-string.txt b/ChangeLog.d/error-include-string.txt
new file mode 100644
index 0000000..0a12c7b
--- /dev/null
+++ b/ChangeLog.d/error-include-string.txt
@@ -0,0 +1,2 @@
+Bugfix
+   * Fix conditions for including string.h in error.c. Fixes #3866.
diff --git a/library/error.c b/library/error.c
index cba61e9..0d9f736 100644
--- a/library/error.c
+++ b/library/error.c
@@ -19,7 +19,7 @@
 
 #include "common.h"
 
-#if defined(MBEDTLS_ERROR_STRERROR_DUMMY)
+#if defined(MBEDTLS_ERROR_C)
 #include <string.h>
 #endif
 
diff --git a/scripts/data_files/error.fmt b/scripts/data_files/error.fmt
index fd72f8b..1c8a790 100644
--- a/scripts/data_files/error.fmt
+++ b/scripts/data_files/error.fmt
@@ -19,7 +19,7 @@
 
 #include "common.h"
 
-#if defined(MBEDTLS_ERROR_STRERROR_DUMMY)
+#if defined(MBEDTLS_ERROR_C)
 #include <string.h>
 #endif