ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/JSOC/base/jsoc_version.h
(Generate patch)

Comparing base/jsoc_version.h (file contents):
Revision 1.26 by arta, Tue Aug 4 15:09:29 2009 UTC vs.
Revision 1.119 by arta, Mon Jun 4 14:30:15 2018 UTC

# Line 13 | Line 13
13  
14   #define JSOC_VERSION_INCL 1
15  
16 < #define jsoc_version "V5R2"
17 < #define jsoc_vers_num (502)
16 > #define jsoc_version "V9R2X"
17 > #define jsoc_vers_num (-902)
18  
19  
20   static inline const char *jsoc_getversion(char *verstr, int size, int *isdev)
21   {
22 <   char *vers = strdup(jsoc_version);
23 <   char *pc = NULL;
24 <   int len = strlen(jsoc_version);
25 <
26 <   if (isdev)
27 <   {
28 <      *isdev = 0;
29 <   }
30 <
31 <   if ((pc = strchr(vers, 'R')) != NULL)
32 <   {
33 <      *pc = '\0';
34 <   }
35 <
36 <   if (jsoc_version[len - 1] == 'X')
37 <   {
38 <      if (isdev)
39 <      {
40 <         *isdev = 1;
41 <      }
42 <    
43 <      vers[len - 1] = '\0';
44 <   }
45 <
46 <   snprintf(verstr, size, "%s.%s", vers + 1, pc + 1);
47 <
48 <   return jsoc_version;
22 >    char *vers = strdup(jsoc_version);
23 >    char *pc = NULL;
24 >    int len = strlen(jsoc_version);
25 >    
26 >    if (vers)
27 >    {
28 >        if (isdev)
29 >        {
30 >            *isdev = 0;
31 >        }
32 >        
33 >        if ((pc = strchr(vers, 'R')) != NULL)
34 >        {
35 >            *pc = '\0';
36 >        }
37 >        
38 >        if (jsoc_version[len - 1] == 'X')
39 >        {
40 >            if (isdev)
41 >            {
42 >                *isdev = 1;
43 >            }
44 >            
45 >            vers[len - 1] = '\0';
46 >        }
47 >        
48 >        snprintf(verstr, size, "%s.%s", vers + 1, pc + 1);
49 >        
50 >        free(vers);
51 >    }
52 >    else
53 >    {
54 >        fprintf(stderr, "Out of memory.\n");
55 >    }  
56 >    
57 >    return jsoc_version;
58   }
59  
60   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines