]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
lib:charset: Update NUM_CHARSETS to reflect true value
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Tue, 11 Jul 2023 01:50:53 +0000 (13:50 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 8 Aug 2023 04:39:37 +0000 (04:39 +0000)
CH_DISPLAY was removed in commit
125a2ff262aa312df20eec68802fd5f8a47f492f, but NUM_CHARSETS was not
updated to match.

By assigning to NUM_CHARSETS the last enumeration value in charset_t, we
guard against its falling out of sync again.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
lib/util/charset/charset.h

index c62832cccd635fdc77e8128b1b9d0b9ad9feb5f2..4eaee1bbb7c6bd173236d0692211783c4aa79f13 100644 (file)
 #include <talloc.h>
 
 /* this defines the charset types used in samba */
-typedef enum {CH_UTF16LE=0, CH_UTF16=0, CH_UNIX, CH_DOS, CH_UTF8, CH_UTF16BE, CH_UTF16MUNGED} charset_t;
-
-#define NUM_CHARSETS 7
+typedef enum {
+       CH_UTF16LE = 0,
+       CH_UTF16 = 0,
+       CH_UNIX,
+       CH_DOS,
+       CH_UTF8,
+       CH_UTF16BE,
+       CH_UTF16MUNGED,
+       /* The number of distinct character sets. */
+       NUM_CHARSETS
+} charset_t;
 
 /*
  * SMB UCS2 (16-bit unicode) internal type.