comparison src/context.cpp @ 417:d1976e04f5ba

spf code now handles mx,exists,ptr tags, multiple A records, %{i} macro
author Carl Byington <carl@five-ten-sg.com>
date Tue, 25 Apr 2017 15:33:38 -0700
parents 7431e948b5c3
children 91f2a127ec69
comparison
equal deleted inserted replaced
416:7431e948b5c3 417:d1976e04f5ba
1146 char adr[sizeof "255.255.255.255 "]; 1146 char adr[sizeof "255.255.255.255 "];
1147 adr[0] = '\0'; 1147 adr[0] = '\0';
1148 inet_ntop(AF_INET, (const u_char *)&priv->ip, adr, sizeof(adr)); 1148 inet_ntop(AF_INET, (const u_char *)&priv->ip, adr, sizeof(adr));
1149 size_t bn = strlen(buf); 1149 size_t bn = strlen(buf);
1150 size_t an = strlen(adr); 1150 size_t an = strlen(adr);
1151 if ((bn - 4 + an) < maxlen) { 1151 if ((bn - 4 + an) < (size_t)maxlen) {
1152 size_t n = p - buf; // leading part length 1152 size_t n = p - buf; // leading part length
1153 strncpy(repl, buf, n); // leading part 1153 strncpy(repl, buf, n); // leading part
1154 strcpy(repl+n, adr); // replacement 1154 strcpy(repl+n, adr); // replacement
1155 strcpy(repl+n+an, buf+n+4); // trailing part 1155 strcpy(repl+n+an, buf+n+4); // trailing part
1156 strcpy(buf, repl); 1156 strcpy(buf, repl);