Fix a few compiler warnings. Fix crash with encrypted undo file.
diff --git a/src/undo.c b/src/undo.c
index 232dbac..22d07d5 100644
--- a/src/undo.c
+++ b/src/undo.c
@@ -1503,13 +1503,19 @@
if (version == UF_VERSION_CRYPT)
{
#ifdef FEAT_CRYPT
+ if (*curbuf->b_p_key == NUL)
+ {
+ EMSG2(_("E832: Non-encrypted file has encrypted undo file: %s"),
+ file_name);
+ goto error;
+ }
if (prepare_crypt_read(fp) == FAIL)
{
EMSG2(_("E826: Undo file decryption failed: %s"), file_name);
goto error;
}
#else
- EMSG2(_("E826: Undo file is encrypted: %s"), file_name);
+ EMSG2(_("E827: Undo file is encrypted: %s"), file_name);
goto error;
#endif
}