Your example has an unmatched double-quote.
Your code has unescaped double-quotes in the first sscanf format.
You haven't defined any space for left and right (they can't just be pointers to nowhere).
(And you should limit the sscanf string inputs to one-less-than their sizes.)
The general problem with using sscanf to do this is that you can't ignore escaped quotes within
the containing quotes. greeting = "hello "there""
Code:
#include <stdio.h>
int main() {
char line[1024], left[256], right[256];
while (fgets(line, sizeof line, stdin) != NULL) {
if ( sscanf (line, "%255[^=] = \"%255[^\"]\"", left, right) == 2
|| sscanf (line, "%255[^=] = '%255[^']'", left, right) == 2
|| sscanf (line, "%255[^=] = %255[^ \t\n;#]", left, right) == 2)
{
printf("[%s] [%s]\n", left, right);
}
}
return 0;
}