Changeset 9bd983 in git for kernel/febase.cc
- Timestamp:
- Nov 7, 2007, 5:14:32 PM (16 years ago)
- Branches:
- (u'spielwiese', '5b153614cbc72bfa198d75b1e9e33dab2645d9fe')
- Children:
- 9a797830a2ee7e455ff1862d3905d68c2b2b18af
- Parents:
- e8d46a5bec7c92ebe23eb113e18b6a8c4b3be957
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/febase.cc
re8d46a r9bd983 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: febase.cc,v 1.1 1 2007-05-25 16:47:32 Singular Exp $ */4 /* $Id: febase.cc,v 1.12 2007-11-07 16:14:32 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: i/o system … … 1053 1053 return; 1054 1054 } 1055 1056 if (feOut) /* do not print when option --no-out was given */ 1055 else if (feOut) /* do not print when option --no-out was given */ 1057 1056 { 1058 1057 … … 1084 1083 if (sprint != NULL) 1085 1084 { 1086 int ls = strlen(fmt);1087 1085 va_list ap; 1088 1086 va_start(ap, fmt); 1089 1087 omCheckAddr(sprint); 1088 int ls = strlen(fmt); 1090 1089 if (fmt != NULL && ls > 0) 1091 1090 { 1092 1091 char* ns; 1093 1092 int l = strlen(sprint); 1094 ns = (char*) omAlloc(sizeof(char)*(ls + l + 256));1093 ns = (char*) omAlloc(sizeof(char)*(ls + l + 512)); 1095 1094 if (l > 0) strcpy(ns, sprint); 1096 1095 1097 1096 #ifdef HAVE_VSNPRINTF 1098 l = vsnprintf(&(ns[l]), ls+ 255, fmt, ap);1097 l = vsnprintf(&(ns[l]), ls+511, fmt, ap); 1099 1098 assume(l != -1); 1100 1099 #else … … 1108 1107 return; 1109 1108 } 1110 if (feOut)1109 else if (feOut) 1111 1110 { 1112 1111 va_list ap; 1113 1112 va_start(ap, fmt); 1114 #ifdef HAVE_TCL 1115 if(tclmode) 1116 #endif 1117 #if defined(HAVE_TCL) 1118 { 1119 char *s=(char *)omAlloc(strlen(fmt)+256); 1120 vsprintf(s,fmt, ap); 1121 #ifdef HAVE_TCL 1122 PrintTCLS('N',s); 1123 #endif 1124 } 1125 #endif 1126 #ifdef HAVE_TCL 1127 else 1128 #endif 1129 { 1130 vfprintf(stdout, fmt, ap); 1131 fflush(stdout); 1132 if (feProt&PROT_O) 1133 { 1134 vfprintf(feProtFile,fmt,ap); 1135 } 1136 } 1113 int ls=strlen(fmt); 1114 char *s=(char *)omAlloc(ls+512); 1115 int l; 1116 #ifdef HAVE_VSNPRINTF 1117 l = vsnprintf(ns, ls+511, fmt, ap); 1118 assume(l != -1); 1119 #else 1120 vsprintf(ns, fmt, ap); 1121 #endif 1122 PrintS(s); 1123 omFree(s); 1137 1124 va_end(ap); 1138 1125 }
Note: See TracChangeset
for help on using the changeset viewer.