- while((len = fread(buf, 1, sizeof(buf), in))) {
- fwrite(buf, len, 1, out);
+ // Check the name of the variable we've read. If it's Port, replace it with
+ // a port we'll use in invitation URL. Otherwise, just copy the line.
+ if(var_end > var_beg && !strncasecmp(var_beg, "Port", var_end - var_beg)) {
+ fprintf(out, "Port = %s\n", port);
+ } else {
+ fprintf(out, "%s", line);
+ }