Commit in reactos/ntoskrnl/rtl on MAIN
atom.c+3-21.8 -> 1.9
Use *NameLength before overwriting it

reactos/ntoskrnl/rtl
atom.c 1.8 -> 1.9
diff -u -r1.8 -r1.9
--- atom.c	7 Dec 2003 10:31:21 -0000	1.8
+++ atom.c	27 Feb 2004 23:11:32 -0000	1.9
@@ -1,4 +1,4 @@
-/* $Id: atom.c,v 1.8 2003/12/07 10:31:21 navaraf Exp $
+/* $Id: atom.c,v 1.9 2004/02/27 23:11:32 gvg Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
@@ -641,13 +641,14 @@
 
    if (NameLength != NULL)
      {
-	*NameLength = AtomEntry->Name.Length;
 	if (AtomName != NULL && *NameLength >= AtomEntry->Name.Length)
 	  {
+	     *NameLength = AtomEntry->Name.Length;
 	     memcpy(AtomName, AtomEntry->Name.Buffer, AtomEntry->Name.Length);
           }
         else
           {
+	     *NameLength = AtomEntry->Name.Length;
 	     RtlpUnlockAtomTable(AtomTable);
 	     return STATUS_BUFFER_TOO_SMALL;
 	  }
CVSspam 0.2.8