␉uint8_t *stringPtr = (uint8_t *)structHeader + structHeader->length;␊ |
␊ |
␉if (!field)␊ |
␉␉return (char *)0;␊ |
␉␉return NULL;␊ |
␊ |
␉for (field--; field != 0 && strlen((char *)stringPtr) > 0; ␊ |
␉␉field--, stringPtr = (uint8_t *)((uint32_t)stringPtr + strlen((char *)stringPtr) + 1));␊ |
|
␉strSize = strlen(string);␊ |
␊ |
␉// remove any spaces found at the end␊ |
␉while ((string[strSize - 1] == ' ') && strSize != 0)␊ |
␉while ((strSize != 0) && (string[strSize - 1] == ' '))␊ |
␉␉strSize--;␊ |
␊ |
␉if (strSize == 0)␊ |
|
␉memcpy((void *)structPtr->new, structPtr->orig, structPtr->orig->length);␊ |
␊ |
␉for (i = 0; i < numOfSetters; i++)␊ |
␉␉if (structPtr->orig->type == SMBSetters[i].type)␊ |
␉␉if ((structPtr->orig->type == SMBSetters[i].type) && (SMBSetters[i].fieldOffset < structPtr->orig->length))␊ |
␉␉{␊ |
␉␉␉if (SMBSetters[i].fieldOffset > structPtr->orig->length)␊ |
␉␉␉␉continue;␊ |
␉␉␉setterFound = true;␊ |
␉␉␉setSMBValue(structPtr, i, (returnType *)((uint8_t *)structPtr->new + SMBSetters[i].fieldOffset));␊ |
␉␉}␊ |