[BACK]Return to line.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / mg

Diff for /src/usr.bin/mg/line.c between version 1.37 and 1.38

version 1.37, 2005/12/20 06:17:36 version 1.38, 2006/05/27 21:20:11
Line 569 
Line 569 
         undo_add_boundary();          undo_add_boundary();
         return (TRUE);          return (TRUE);
 }  }
   
   /*
    * Allocate and return the supplied line as a C string
    */
   char *
   linetostr(const struct line *ln)
   {
           size_t   len;
           char    *line;
   
           len = llength(ln);
           if (len == SIZE_MAX)  /* (len + 1) overflow */
                   return (NULL);
   
           if ((line = malloc(len + 1)) == NULL)
                   return (NULL);
   
           (void)memcpy(line, ltext(ln), len);
           line[len] = '\0';
   
           return (line);
   }

Legend:
Removed from v.1.37  
changed lines
  Added in v.1.38