… | |
… | |
942 | * This adds exp to a player. We now allow adding to a specific skill. |
942 | * This adds exp to a player. We now allow adding to a specific skill. |
943 | */ |
943 | */ |
944 | int |
944 | int |
945 | command_addexp (object *op, char *params) |
945 | command_addexp (object *op, char *params) |
946 | { |
946 | { |
947 | char buf[MAX_BUF], skill[MAX_BUF]; |
947 | char buf[1024], skill[1024]; |
948 | int q; |
948 | int q; |
949 | long long i; // use sint64 and finally provide format specifiers for sint64 etc. via configure |
949 | sint64 i; |
950 | object *skillob = NULL; |
950 | object *skillob = NULL; |
951 | |
951 | |
952 | skill[0] = '\0'; |
952 | skill[0] = '\0'; |
953 | if ((params == NULL) || (strlen (params) > MAX_BUF) || ((q = sscanf (params, "%s %lld %[^\n]", buf, &i, skill)) < 2)) |
953 | if ((params == NULL) || (strlen (params) > MAX_BUF) || ((q = sscanf (params, "%1023s %" SCNd64 " %1023[^\n]", buf, &i, skill)) < 2)) |
954 | { |
954 | { |
955 | new_draw_info (NDI_UNIQUE, 0, op, "Usage: addexp <who> <how much> [<skill>]."); |
955 | new_draw_info (NDI_UNIQUE, 0, op, "Usage: addexp <who> <how much> [<skill>]."); |
956 | return 1; |
956 | return 1; |
957 | } |
957 | } |
958 | |
958 | |