C String Processing -- magnet link example
Your code is nicely written and you have checked for errors well.  It
is perhaps a little over-commented, many of the comments explaining
the obvious (and hence being just 'noise').

String handling in C is messy and there are always many ways of
achieving the same thing.  There's nothing really wrong with using
snprintf although it can be less efficient than using strcat and
friends.  Since you are using snprintf I'll concentrate on
how you use it and ignore any alternatives.  Someone else might like
to comment on them.

You first append the command line parameter:

if (20 + strlen(argv[1]) &gt;= SIZE)
    die(1, "buffer overflow detected");

bufEnd = buf + snprintf(buf, SIZE, "magnet:?xt=urn:btih:%s", argv[1]);


In this you have traversed argv[1] twice, once in the strlen call
and then again in snprintf.  You could avoid one of these:

const char *limit = buf + sizeof buf;
char *in = buf;

in += snprintf(in, limit-in, "magnet:?xt=urn:btih:%s", argv[1]);
if (in &gt;= limit) {
    die(1, "buffer overflow detected");
}


This is more efficient and also avoids embedding the magic number 20
(embedded constants are usually best avoided).  It uses the fact the
snprintf returns the number of bytes needed for the string it wanted
to print but doesn't overflow the buffer.  So if it returns a number 
greater than or equal to the space available , you know there was an 
overflow.  I also changed bufEnd to in, used limit to mark the 
end of the buffer and added braces around the call to die

Within your while loop you also traverse each string twice.  The
same technique as above can be used to avoid this.  Also your check
for blank lines does not trap lines that contains white-space as well
as a \n.  For that you might use:

const char *s = line + strspn(line, " \t\r\n");
if (*s == '\0')
    continue;