Changeset 25 for trunk


Ignore:
Timestamp:
Dec 20, 2005, 3:32:26 PM (14 years ago)
Author:
jtv
Message:

Moved some of the URL generation out of the central loop

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ui_web.c

    r24 r25  
    207207    int fd;
    208208    size_t bytes;
     209    char url[200];
     210    size_t urlhead;
    209211
    210212    if (!mines_togo(F))
     
    231233    mines_moves(F), mines_togo(F));
    232234    printf("<form action=\"%s\" method=\"GET\"><table>", scriptname);
     235    urlhead = sprintf(url, "<a href=\"%s?game=%s&atr=", scriptname, id);
    233236    for (r=-1; r<=rows; ++r)
    234237    {
     238      sprintf(url+urlhead, "%d&atc=", r);
     239
    235240      printf("<tr>");
    236241      for (c=-1; c<=cols; ++c)
     
    239244    printf("<td>");
    240245    if (done || x != '^') printf("%c", x);
    241     else printf("<a href=\"%s?game=%s&atr=%d&atc=%d\">=</a>",
    242           scriptname,id,r,c);
     246    else printf("%s%d\">=</a>",url,c);
    243247    printf("</td>");
    244248      }
Note: See TracChangeset for help on using the changeset viewer.