Automatic date update in version.in
[deliverable/binutils-gdb.git] / bfd / vms-misc.c
index 0826456ef0ff910552a98c3566be86eeda82e143..3fd974c6e7032febf81145d73fc7cfc028351502 100644 (file)
@@ -1,6 +1,6 @@
 /* vms-misc.c -- BFD back-end for VMS/VAX (openVMS/VAX) and
    EVAX (openVMS/Alpha) files.
-   Copyright (C) 1996-2020 Free Software Foundation, Inc.
+   Copyright (C) 1996-2021 Free Software Foundation, Inc.
 
    Miscellaneous functions.
 
@@ -163,9 +163,12 @@ _bfd_vms_save_sized_string (bfd *abfd, unsigned char *str, size_t size)
 char *
 _bfd_vms_save_counted_string (bfd *abfd, unsigned char *ptr, size_t maxlen)
 {
-  unsigned int len = *ptr++;
+  unsigned int len;
 
-  if (len > maxlen)
+  if (maxlen == 0)
+    return NULL;
+  len = *ptr++;
+  if (len >  maxlen - 1)
     return NULL;
   return _bfd_vms_save_sized_string (abfd, ptr, len);
 }
@@ -431,9 +434,9 @@ static int
 vms_convert_to_var_1 (char *filename, int type)
 {
   if (type != DECC$K_FILE)
-    return FALSE;
+    return false;
   vms_convert_to_var (filename);
-  return TRUE;
+  return true;
 }
 
 /* Convert the file to variable record length format. This is done
@@ -444,8 +447,8 @@ int
 _bfd_vms_convert_to_var_unix_filename (const char *unix_filename)
 {
   if (decc$to_vms (unix_filename, &vms_convert_to_var_1, 0, 1) != 1)
-    return FALSE;
-  return TRUE;
+    return false;
+  return true;
 }
 #endif /* VMS */
 
@@ -453,9 +456,8 @@ _bfd_vms_convert_to_var_unix_filename (const char *unix_filename)
    stolen from obj-vms.c.  */
 
 unsigned char *
-get_vms_time_string (void)
+get_vms_time_string (unsigned char *tbuf)
 {
-  static unsigned char tbuf[18];
 #ifndef VMS
   char *pnt;
   time_t timeb;
@@ -490,7 +492,7 @@ get_vms_time_string (void)
    The result has to be free().  */
 
 char *
-vms_get_module_name (const char *filename, bfd_boolean upcase)
+vms_get_module_name (const char *filename, bool upcase)
 {
   char *fname, *fptr;
   const char *fout;
This page took 0.0263 seconds and 4 git commands to generate.