OSSP CVS Repository

ossp - Check-in [4307]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 4307
Date: 2001-Aug-09 17:29:58 (local)
2001-Aug-09 15:29:58 (UTC)
User:simons
Branch:
Comment: Made the code in extended.c more elegant.
Tickets:
Inspections:
Files:
ossp-pkg/xds/docs/extended.c      1.2 -> 1.3     4 inserted, 6 deleted
ossp-pkg/xds/docs/libxds.tex      1.12 -> 1.13     5 inserted, 7 deleted

ossp-pkg/xds/docs/extended.c 1.2 -> 1.3

--- extended.c   2001/08/09 15:25:57     1.2
+++ extended.c   2001/08/09 15:29:58     1.3
@@ -35,12 +35,10 @@
                     &tmp, &i);
     if (rc == XDS_OK)
         {
-        if (i != sizeof(ms->text))
-            {
-            free(tmp);
-            return XDS_ERR_TYPE_MISMATCH;
-            }
-        memmove(ms->text, tmp, i);
+        if (i == sizeof(ms->text))
+            memmove(ms->text, tmp, i);
+        else
+            rc = XDS_ERR_TYPE_MISMATCH;
         free(tmp);
         }
     return rc;


ossp-pkg/xds/docs/libxds.tex 1.12 -> 1.13

--- libxds.tex   2001/08/09 15:25:57     1.12
+++ libxds.tex   2001/08/09 15:29:58     1.13
@@ -1,6 +1,6 @@
 % -*- mode: LaTeX; fill-column: 75; -*-
 %
-% $Id: libxds.tex,v 1.12 2001/08/09 15:25:57 simons Exp $
+% $Id: libxds.tex,v 1.13 2001/08/09 15:29:58 simons Exp $
 %
 \documentclass[a4paper,10pt,pointlessnumbers,bibtotoc]{scrartcl}
 \usepackage[dvips,xdvi]{graphicx}
@@ -709,12 +709,10 @@
                     &tmp, &i);
     if (rc == XDS_OK)
         {
-        if (i != sizeof(ms->text))
-            {
-            free(tmp);
-            return XDS_ERR_TYPE_MISMATCH;
-            }
-        memmove(ms->text, tmp, i);
+        if (i == sizeof(ms->text))
+            memmove(ms->text, tmp, i);
+        else
+            rc = XDS_ERR_TYPE_MISMATCH;
         free(tmp);
         }
     return rc;

CVSTrac 2.0.1