Diff for /qemu/cutils.c between versions 1.1.1.1 and 1.1.1.2

version 1.1.1.1, 2018/04/24 16:44:47 version 1.1.1.2, 2018/04/24 16:47:10
Line 1 Line 1
 /*  /*
  * Simple C functions to supplement the C library   * Simple C functions to supplement the C library
  *    *
  * Copyright (c) 2006 Fabrice Bellard   * Copyright (c) 2006 Fabrice Bellard
  *   *
  * Permission is hereby granted, free of charge, to any person obtaining a copy   * Permission is hereby granted, free of charge, to any person obtaining a copy
Line 21 Line 21
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.   * THE SOFTWARE.
  */   */
 #include "vl.h"  #include "qemu-common.h"
   
 void pstrcpy(char *buf, int buf_size, const char *str)  void pstrcpy(char *buf, int buf_size, const char *str)
 {  {
Line 45  char *pstrcat(char *buf, int buf_size, c Line 45  char *pstrcat(char *buf, int buf_size, c
 {  {
     int len;      int len;
     len = strlen(buf);      len = strlen(buf);
     if (len < buf_size)       if (len < buf_size)
         pstrcpy(buf + len, buf_size - len, s);          pstrcpy(buf + len, buf_size - len, s);
     return buf;      return buf;
 }  }
Line 81  int stristart(const char *str, const cha Line 81  int stristart(const char *str, const cha
         *ptr = p;          *ptr = p;
     return 1;      return 1;
 }  }
   
   time_t mktimegm(struct tm *tm)
   {
       time_t t;
       int y = tm->tm_year + 1900, m = tm->tm_mon + 1, d = tm->tm_mday;
       if (m < 3) {
           m += 12;
           y--;
       }
       t = 86400 * (d + (153 * m - 457) / 5 + 365 * y + y / 4 - y / 100 + 
                    y / 400 - 719469);
       t += 3600 * tm->tm_hour + 60 * tm->tm_min + tm->tm_sec;
       return t;
   }

Removed from v.1.1.1.1  
changed lines
  Added in v.1.1.1.2


unix.superglobalmegacorp.com