On an arduino calling sscanf() or sprintf() adds a giant function to the code base. It’s sometimes a necessary evil but in your case you should replace all the
sprintf(xxxxxx,"%s",var1);
by
strcpy(xxxxxx,var1);
As you only copy the string.
Ideally you would make this more robust with strncpy() and taking into account buffer size and the possible needed addition of a trailing ‘\0’