Changeset cdfcdb in git for Singular/fehelp.cc


Ignore:
Timestamp:
May 31, 2023, 11:16:52 AM (12 months ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b4f17ed1d25f93d46dbe29e4b499baecc2fd51bb')
Children:
8eeddafc83e9d052d7ffa21597c4229513b7e886
Parents:
e4953e241ca9796e2dcaa9e6228345429b6f4a96
Message:
format: and sprintf -> snprintf
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/fehelp.cc

    re4953e rcdfcdb  
    934934                     if (*p=='H')
    935935                     #ifdef SINGULAR_4_2
    936                        sprintf(temp,"%s/%d-%d/%s", htmldir,
     936                       snprintf(temp,256,"%s/%d-%d/%s", htmldir,
    937937                                  SINGULAR_VERSION/1000,
    938938                                 (SINGULAR_VERSION % 1000)/100,
    939939                       hentry->url);
    940940                     else
    941                        sprintf(temp,"%s/%s", htmldir, hentry->url);
     941                       snprintf(temp,256,"%s/%s", htmldir, hentry->url);
    942942                     #else
    943                        sprintf(temp,"%s/%d-%d-%d/%s", htmldir,
     943                       snprintf(temp,256,"%s/%d-%d-%d/%s", htmldir,
    944944                                  SINGULAR_VERSION/1000,
    945945                                 (SINGULAR_VERSION % 1000)/100,
     
    947947                       hentry->url);
    948948                     else
    949                        sprintf(temp,"%s/%s", htmldir, hentry->url);
     949                       snprintf(temp,256,"%s/%s", htmldir, hentry->url);
    950950                     #endif
    951951                   }
     
    953953                     if (*p=='H')
    954954                     #ifdef SINGULAR_4_2
    955                        sprintf(temp,"%s/%d-%d/index.htm", htmldir,
     955                       snprintf(temp,256,"%s/%d-%d/index.htm", htmldir,
    956956                                  SINGULAR_VERSION/1000,
    957957                                 (SINGULAR_VERSION % 1000)/100
    958958                       );
    959959                     #else
    960                        sprintf(temp,"%s/%d-%d-%d/index.htm", htmldir,
     960                       snprintf(temp,256,"%s/%d-%d-%d/index.htm", htmldir,
    961961                                  SINGULAR_VERSION/1000,
    962962                                 (SINGULAR_VERSION % 1000)/100,
     
    965965                     #endif
    966966                     else
    967                        sprintf(temp,"%s/index.htm", htmldir);
     967                       snprintf(temp,256,"%s/index.htm", htmldir);
    968968                   }
    969969                   #endif
     
    998998                   char temp[256];
    999999                   if ((hentry!=NULL) && (*(hentry->node) != '\0'))
    1000                      sprintf(temp,"%s",hentry->node);
     1000                     snprintf(temp,256,"%s",hentry->node);
    10011001                   //else if ((hentry!=NULL) && (hentry->key!=NULL))
    1002                    //  sprintf(temp,"Index '%s'",hentry->key);
     1002                   //  snprintf(temp,256,"Index '%s'",hentry->key);
    10031003                   else
    1004                      sprintf(temp,"Top");
     1004                     snprintf(temp,256,"Top");
    10051005                   strcat(sys,temp);
    10061006                   i=strlen(sys);
     
    10101010                 {
    10111011                   char temp[256];
    1012                    sprintf(temp,"%d-%d-%d",SINGULAR_VERSION/1000,
     1012                   snprintf(temp,256,"%d-%d-%d",SINGULAR_VERSION/1000,
    10131013                                 (SINGULAR_VERSION % 1000)/100,
    10141014                                 (SINGULAR_VERSION % 100)/10);
     
    11451145    p++;
    11461146    *p='\0';
    1147     (void)sprintf(String, " %s ", str);
     1147    snprintf(String,IDX_LEN+1, " %s ", str);
    11481148  }
    11491149  else
    11501150  {
    1151     (void)sprintf(String, " %s", str);
     1151    snprintf(String,IDX_LEN+1, " %s", str);
    11521152  }
    11531153
     
    11751175   {
    11761176     #ifdef SINGULAR_4_2
    1177      sprintf(temp,"%s/%d-%d/%s", htmldir,
     1177     snprintf(temp,256,"%s/%d-%d/%s", htmldir,
    11781178     SINGULAR_VERSION/1000,
    11791179     (SINGULAR_VERSION % 1000)/100,
    11801180     #else
    1181      sprintf(temp,"%s/%d-%d-%d/%s", htmldir,
     1181     snprintf(temp,256,"%s/%d-%d-%d/%s", htmldir,
    11821182     SINGULAR_VERSION/1000,
    11831183     (SINGULAR_VERSION % 1000)/100,
Note: See TracChangeset for help on using the changeset viewer.