Changeset 04b2b17e96842aca30ef97ef450e486f446206d3
- Timestamp:
- 11/13/10 14:02:20 (3 years ago)
- Author:
- Nedko Arnaudov <nedko@…>
- Children:
- 3752081d1de2bd77d8bc7fb35ebfb0919b8de5e6
- Parents:
- c0240447c1f018bcb69fceaf073a43ed8e304e8a
- git-committer:
- Nedko Arnaudov <nedko@arnaudov.name> / 2010-11-13T14:02:20Z+0200
- Message:
-
ladishd: project name unescaping
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
rbea7c69
|
r04b2b17
|
|
| 77 | 77 | uint32_t port_type; |
| 78 | 78 | uint32_t port_flags; |
| | 79 | size_t len; |
| 79 | 80 | |
| 80 | 81 | if (context_ptr->error) |
| … |
… |
|
| 101 | 102 | } |
| 102 | 103 | |
| 103 | | log_info("Project '%s' with uuid %s", name, uuid_str); |
| 104 | | |
| 105 | | room_ptr->project_name = strdup(name); |
| | 104 | len = strlen(name) + 1; |
| | 105 | room_ptr->project_name = malloc(len); |
| 106 | 106 | if (room_ptr->project_name == NULL) |
| 107 | 107 | { |
| 108 | | log_error("strdup() failed for project name"); |
| 109 | | context_ptr->error = XML_TRUE; |
| 110 | | return; |
| 111 | | } |
| | 108 | log_error("malloc() failed for project name with length %zu", len); |
| | 109 | context_ptr->error = XML_TRUE; |
| | 110 | return; |
| | 111 | } |
| | 112 | |
| | 113 | room_ptr->project_name[unescape(name, len, room_ptr->project_name)] = 0; |
| | 114 | |
| | 115 | log_info("Project '%s' with uuid %s", room_ptr->project_name, uuid_str); |
| 112 | 116 | |
| 113 | 117 | uuid_copy(room_ptr->project_uuid, uuid); |
| … |
… |
|
| 780 | 784 | const char * uuid_str; |
| 781 | 785 | uuid_t uuid; |
| | 786 | size_t len; |
| 782 | 787 | |
| 783 | 788 | if (strcmp(el, "project") == 0) |
| … |
… |
|
| 785 | 790 | if (ladish_get_name_and_uuid_attributes("/project", attr, &name, &uuid_str, uuid)) |
| 786 | 791 | { |
| 787 | | context_ptr->str = strdup(name); |
| | 792 | len = strlen(name) + 1; |
| | 793 | context_ptr->str = malloc(len); |
| 788 | 794 | if (context_ptr->str == NULL) |
| 789 | 795 | { |
| 790 | | log_error("strdup() failed for project name"); |
| 791 | | } |
| | 796 | log_error("malloc() failed for project name with length %zu", len); |
| | 797 | } |
| | 798 | |
| | 799 | context_ptr->str[unescape(name, len, context_ptr->str)] = 0; |
| 792 | 800 | } |
| 793 | 801 | |